question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

useCookies causes Nuxt not to work compiled on Windows

See original GitHub issue

Environment

  • 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:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
nndnhacommented, Dec 1, 2021

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

0reactions
frbucetacommented, Dec 1, 2021

@frbuceta By a reproduction, I mean:

Please provide a link to a repo that can reproduce the problem you ran into. A minimal reproduction is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a “need reproduction” label. If no reproduction is provided we might close it.

It seems that codesandbox also fails, I have already uploaded the reproduction.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found