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

ReferenceError: url is not defined #1851

Closed
Barbapapazes opened this issue Jan 26, 2023 · 8 comments
Closed

ReferenceError: url is not defined #1851

Barbapapazes opened this issue Jan 26, 2023 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@Barbapapazes
Copy link
Contributor

Barbapapazes commented Jan 26, 2023

Environment

Nuxi 3.1.0 08:40:31
08:40:32
RootDir: C:/Users/esoubiran/dev/barbapapazes/le-classement.fr 08:40:32
Nuxt project info: 08:40:32



Reproduction

https://stackblitz.com/edit/github-sospeq-jtqvnp?file=content/about.md

Describe the bug

URL can't be founded.

Additional context

No response

Logs

[nitro] [dev] [unhandledRejection] ReferenceError: url is not defined                                                                             08:39:00
    at refreshHead (C:\Users\esoubiran\dev\barbapapazes\le-classement.fr\node_modules\@nuxt\content\dist\runtime\composables\head.mjs:72:138)
    at callWithErrorHandling (C:\Users\esoubiran\dev\barbapapazes\le-classement.fr\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:157:22)
    at callWithAsyncErrorHandling (C:\Users\esoubiran\dev\barbapapazes\le-classement.fr\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:166:21)
    at doWatch (C:\Users\esoubiran\dev\barbapapazes\le-classement.fr\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:1752:13)
    at Module.watch (C:\Users\esoubiran\dev\barbapapazes\le-classement.fr\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:1663:12)
    at Module.useContentHead (C:\Users\esoubiran\dev\barbapapazes\le-classement.fr\node_modules\@nuxt\content\dist\runtime\composables\head.mjs:107:25)
    at setup (C:\Users\esoubiran\dev\barbapapazes\le-classement.fr\node_modules\@nuxt\content\dist\runtime\pages\document-driven.vue:26:27)
    at _sfc_main.setup (C:\Users\esoubiran\dev\barbapapazes\le-classement.fr\node_modules\@nuxt\content\dist\runtime\pages\document-driven.vue:93:23)
    at callWithErrorHandling (C:\Users\esoubiran\dev\barbapapazes\le-classement.fr\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:157:22)
    at setupStatefulComponent (C:\Users\esoubiran\dev\barbapapazes\le-classement.fr\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:7176:29)

No response

@atinux atinux added the bug Something isn't working label Jan 26, 2023 — with Volta.net
Copy link
Member

atinux commented Jan 26, 2023

I don't have any problem in the reproduction @Barbapapazes

Copy link
Contributor Author

ah

Copy link
Contributor Author

Barbapapazes commented Jan 26, 2023

Ok, I know why ! Wait a little and navigate through pages. The error will appear in the console.

Copy link
Contributor Author

image.png

Some time passed between the hmr ready and the error.

@tex0l
Copy link

tex0l commented Jan 26, 2023

I have the same issue that appeared in my generate logs, it comes from this line:

content: host && !hasProtocol(image) ? new URL(joinURL(config.app.baseURL, image), url).href : image

@tex0l
Copy link

tex0l commented Jan 26, 2023

I think this is a regression introduced in #1769, there is a ts-ignore which prevents TS from warning, but url is just not defined in this scope.

It is defined there:

const url = config.public.content.trailingSlash ? withTrailingSlash(_url) : withoutTrailingSlash(_url)

but that's a different block scope.

@farnabaz
Copy link
Member

This should be fixed in edge channel, we will release a hotfix today v2.4.1

@tex0l
Copy link

tex0l commented Jan 26, 2023

I can confirm the edge channel works with the latest fix.

@farnabaz farnabaz mentioned this issue Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants