Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Only absolute URLs are supported #5

Open
p-null opened this issue Aug 7, 2020 · 1 comment
Open

TypeError: Only absolute URLs are supported #5

p-null opened this issue Aug 7, 2020 · 1 comment

Comments

@p-null
Copy link

p-null commented Aug 7, 2020

Hi I git clone the master branch and do yarn to install node modules.
When I do yarn dev I have the following error:

image

The console output:

index.js:247 Uncaught     at getNodeRequestOptions (file:///home/tingkai/nextjs_app/Making-Websites-With-Next.js-And-Strapi/node_modules/next/dist/compiled/node-fetch/index.js:1:145647)
    at <unknown> (file:///home/tingkai/nextjs_app/Making-Websites-With-Next.js-And-Strapi/node_modules/next/dist/compiled/node-fetch/index.js:1:147021)
    at new Promise (<anonymous>)
    at fetch (file:///home/tingkai/nextjs_app/Making-Websites-With-Next.js-And-Strapi/node_modules/next/dist/compiled/node-fetch/index.js:1:146956)
    at Function.module.exports../pages/_app.js.MyApp.getInitialProps (file:///home/tingkai/nextjs_app/Making-Websites-With-Next.js-And-Strapi/.next/server/pages/_app.js:2929:78)
    at loadGetInitialProps (file:///home/tingkai/nextjs_app/Making-Websites-With-Next.js-And-Strapi/node_modules/next/dist/next-server/lib/utils.js:5:101)
    at renderToHTML (file:///home/tingkai/nextjs_app/Making-Websites-With-Next.js-And-Strapi/node_modules/next/dist/next-server/server/render.js:22:1221)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async (file:///home/tingkai/nextjs_app/Making-Websites-With-Next.js-And-Strapi/node_modules/next/dist/next-server/server/next-server.js:76:329)
    at async (file:///home/tingkai/nextjs_app/Making-Websites-With-Next.js-And-Strapi/node_modules/next/dist/next-server/server/next-server.js:75:142)

Do you have any thoughts on what could be wrong?
Thanks!

Other info

OS: WSL2 Ubuntu 20.04 LTS
node: v14.5.0
@ivandoric
Copy link
Owner

ivandoric commented Aug 10, 2020

Did you try hard coding the URL to your API instead of using PublicRuntimeConfig etc. Because your API_URL should be in .env file, and that file is not in the git repo. You need to create it yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants