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

got reference error __VUE_PROD_DEVTOOLS__ is not defined when using https://unpkg.com/vue@3/dist/vue.esm-browser.js #10039

Closed
thinlizzy opened this issue Jan 8, 2024 · 11 comments

Comments

@thinlizzy
Copy link

Vue version

3.4.6

Link to minimal reproduction

https://vuejs.org/guide/quick-start.html#enabling-import-maps

Steps to reproduce

create a Vue app by using import maps by following this link: https://vuejs.org/guide/quick-start.html#enabling-import-maps

What is expected?

the app should work

What is actually happening?

app doesn't load and we get the following error in the js console:

Uncaught ReferenceError: __VUE_PROD_DEVTOOLS__ is not defined 
<anonymous> runtime-core.esm-bundler.js:8070

System Info

No response

Any additional comments?

No response

@thinlizzy thinlizzy changed the title get reference error __VUE_PROD_DEVTOOLS__ is not defined when using https://unpkg.com/vue@3/dist/vue.esm-browser.js got reference error __VUE_PROD_DEVTOOLS__ is not defined when using https://unpkg.com/vue@3/dist/vue.esm-browser.js Jan 8, 2024
@LinusBorg
Copy link
Member

LinusBorg commented Jan 8, 2024

The error message you posted shows that you used runtime-core.esm-BUNDLER.js, while you want to use runtime-core.esm-BROWSER.js

As there was no runnable reproduction provided, I'm assuming that already was the mistake and can close this.

@thinlizzy
Copy link
Author

I am literally using this:

	<script type="importmap">
{
	"imports": {
		"vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js"
	}
}
	</script>

@LinusBorg
Copy link
Member

That may be the case. I can't replicate what you do since you did not share a reproduction.

Something on your end seems to import the bundler vue version. Thats not normal. What that is, I cant guess.

@thinlizzy
Copy link
Author

Sorry. Here is http://baudejogos.net/vuetest.html

It's a simple test example that worked before and now it keeps crashing with that same error. This is happening in the rest of the site.

Wondering why suddenly the bundler became in the way...

@LinusBorg
Copy link
Member

LinusBorg commented Jan 9, 2024

If you check your network tab - that happens because of the other package you have incluced, which you get from jsdelivr.

jsdelivr's esm support automatically rewrites imports the the matching urls on jsdelivr, and that rewrite results in a rewrite to esm-bundler.

Are you saying this exact same file from jsdelivr worked before?

@interesse
Copy link

I have the same issue. I can reproduce it with the example given by Parcel with a production build.

It still worked in version v3.4.0-rc.1 and is broken since version v3.4.0-rc.2. I assume it broke with this commit: ee68c52#diff-5ab5fe7b450649335062cee0ca4f1499ae23f78f1460b187873afbe21093ef0bR160

@thinlizzy
Copy link
Author

If you check your network tab - that happens because of the other package you have incluced, which you get from jsdelivr.

jsdelivr's esm support automatically rewrites imports the the matching urls on jsdelivr, and that rewrite results in a rewrite to esm-bundler.

Are you saying this exact same file from jsdelivr worked before?

exactly. it worked since I started using v-viewer in my website. it broke approximately last week :(

do you know is there a fix or workaround to make it to work again?

@LinusBorg
Copy link
Member

I have the same issue. I can reproduce it with the example given by Parcel with a production build.

It still worked in version v3.4.0-rc.1 and is broken since version v3.4.0-rc.2. I assume it broke with this commit: ee68c52#diff-5ab5fe7b450649335062cee0ca4f1499ae23f78f1460b187873afbe21093ef0bR160

That sounds like a different issue, namely that Parcel doesn't support that new Flag yet which the bundler version expects to be set one way or another. You should be able to inject that as a global yourself through parcel's config

@interesse
Copy link

That sounds like a different issue, namely that Parcel doesn't support that new Flag yet which the bundler version expects to be set one way or another. You should be able to inject that as a global yourself through parcel's config

Then the documentation is wrong because it states in multiple places:

Vue will work even if these flags are not explicitly configured

e.g.

@LinusBorg
Copy link
Member

LinusBorg commented Jan 9, 2024

You're right insofar as the handling of the defaults happens in the build tool integrations, and Parcel's vue integration is not maintained by us. (You also don't find a Parcel section on our docs.

We can likely amend the docs in that regard.

Still, no related to this issue here.

@thinlizzy
Copy link
Author

<script>
	var __VUE_PROD_DEVTOOLS__ = false
</script>

I solved everything with this at the start of my html...

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

No branches or pull requests

3 participants