useCookies causes Nuxt not to work compiled on Windows
See original GitHub issueEnvironment
- Operating System:
Windows_NT
- Node Version:
v16.13.0
- Nuxt Version:
3.0.0-27303148.ac98373
- Package Manager:
npm@8.1.0
- Bundler:
Vite
- User Config:
css
,watch
,build
- Runtime Modules:
-
- Build Modules:
-
Reproduction
https://codesandbox.io/s/gfoqc
Describe the bug
It seems that when Nuxt is compiled and used (compiled) on Windows it fails by using the useCookies function.On macOS it works!
Additional context
No response
Logs
TypeError: Cannot read properties of undefined (reading 'default')
at useCookie (file:///C:/Users/josea/Documents/GitHub/mailchimp-campaign-creator/.output/server/chunks/server.mjs:3628:84)
at setup (file:///C:/Users/josea/Documents/GitHub/mailchimp-campaign-creator/.output/server/chunks/server.mjs:6852:20)
at _sfc_main$2.setup (file:///C:/Users/josea/Documents/GitHub/mailchimp-campaign-creator/.output/server/chunks/server.mjs:7065:25)
at callWithErrorHandling (file:///C:/Users/josea/Documents/GitHub/mailchimp-campaign-creator/.output/server/chunks/index2.mjs:7159:22)
at setupStatefulComponent (file:///C:/Users/josea/Documents/GitHub/mailchimp-campaign-creator/.output/server/chunks/index2.mjs:6875:29)
at setupComponent (file:///C:/Users/josea/Documents/GitHub/mailchimp-campaign-creator/.output/server/chunks/index2.mjs:6856:11)
at renderComponentVNode (file:///C:/Users/josea/Documents/GitHub/mailchimp-campaign-creator/.output/server/chunks/index2.mjs:9765:17)
at renderVNode (file:///C:/Users/josea/Documents/GitHub/mailchimp-campaign-creator/.output/server/chunks/index2.mjs:9871:22)
at renderComponentSubTree (file:///C:/Users/josea/Documents/GitHub/mailchimp-campaign-creator/.output/server/chunks/index2.mjs:9836:13)
at file:///C:/Users/josea/Documents/GitHub/mailchimp-campaign-creator/.output/server/chunks/index2.mjs:9778:29
[Vue warn]: Component is missing template or render function.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Nuxt.js for Busy Developers - CODE Magazine
Nuxt.js is a Web development framework that builds on top of the Vue.js framework. It's not a new framework and nor does it...
Read more >My web performance journey with Nuxt, Storyblok & Netlify
In this post I will show you the main web performance concerns I had while building my website and how a Jamstack architecture...
Read more >WebStorm 2020.2: Use Prettier as the Default Formatter, Work ...
WebStorm 2020.2 comes with the option to use Prettier as the default formatter, new intentions for JavaScript, and more.
Read more >Nuxt.js over Vue.js: when should you use it and why | Bornfight
Nuxt.js is a front-end framework built upon Vue.js that offers great ... while Nuxt is not, and that can cause major problems in...
Read more >“window is not defined” in Nuxt.js - Stack Overflow
js to Nuxt.js. I am trying to use vue-session in node_modules . It compiles successfully, but in the browser I see the error ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think there is a typo error in this line that causes this bug https://github.com/nuxt/framework/blob/010febd1b3dde2bdac2f246156724bbb2571932b/packages/nuxt3/src/app/composables/cookie.ts#L28
It should be opts.default instead of _opts.default
It seems that codesandbox also fails, I have already uploaded the reproduction.