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

Babel "loose" mode option #268

Closed
visini opened this issue May 6, 2021 · 17 comments
Closed

Babel "loose" mode option #268

visini opened this issue May 6, 2021 · 17 comments
Labels
type: bug Something isn't working

Comments

@visini
Copy link

visini commented May 6, 2021

Version

nuxt-edge@2.16.0-27004333.1676b861
@nuxtjs/storybook@4.0.2

Steps to reproduce

Newest nuxt-edge version fixes the below console error for nuxt, but still shows up for nuxt-storybook...

Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-proposal-private-methods.The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by exp

See original issue at nuxt/nuxt#9224 and fix at nuxt/nuxt#9232

@visini visini added the type: bug Something isn't working label May 6, 2021
@pi0
Copy link

pi0 commented May 9, 2021

nuxt/nuxt#9224 (comment)

@rockmandash
Copy link

rockmandash commented May 11, 2021

I have the same problem in Nuxt storybook, manually adding to nuxt.config.js

{
  build: {
    babel: {
      plugins: [
        // https://github.com/nuxt/nuxt.js/issues/9224#issuecomment-830577523
        ['@babel/plugin-proposal-private-property-in-object', { loose: true }],
      ],
    },
  },
}

didn't silence the warning.

@productdevbook
Copy link

productdevbook commented May 15, 2021

@pi0 some problem, 2.15.6
In case of having same issue after upgrading to 2.15.6, please remove lock file (yarn.lock or package.lock.json), node_modules/.cache and .nuxt. If still having issues, please report here.
dont fixed

@pi0
Copy link

pi0 commented May 15, 2021

Then we may have same issue in storybook generated webpack/babel config. /cc @farnabaz

@DominusKelvin
Copy link

Any way to fix this yet?

@irving-caamal
Copy link

babel

This works for me, I also have a babel.config.json file with this config.

{ "presets": [ [ "@babel/preset-env", { "targets": { "node": true } } ] ] }

@andrevandal
Copy link

babel

This works for me, I also have a babel.config.json file with this config.

{ "presets": [ [ "@babel/preset-env", { "targets": { "node": true } } ] ] }

not for me :(

@hacknug
Copy link

hacknug commented May 27, 2021

This works for me, I also have a babel.config.json file with this config.

{ "presets": [ [ "@babel/preset-env", { "targets": { "node": true } } ] ] }

Didn't work for me either. This other one did though: nuxt/nuxt#9224 (comment)

@nigelellis
Copy link

Pinning the versions via. yarn resolutions also worked for me -- nuxt/nuxt#9224 (comment)

@andrevandal
Copy link

andrevandal commented May 28, 2021 via email

Copy link
Collaborator

This will fix in the next release #277

@farnabaz farnabaz mentioned this issue May 31, 2021
@productdevbook
Copy link

productdevbook commented May 31, 2021

dont fixed @farnabaz .nuxt, .nuxt-storybook, node_modules delete and yarn and repeat dev some problem
CleanShot 2021-05-31 at 19 47 05

@krisimmig
Copy link

I also still have the same message, adding

plugins: [
  // https://github.com/nuxt/nuxt.js/issues/9224#issuecomment-830577523
  ["@babel/plugin-proposal-private-property-in-object", { loose: true }],
],

to nuxt.config.js also didn't change it. Using "@nuxtjs/storybook": "^4.0.3",

@farnabaz
Copy link
Collaborator

farnabaz commented Jun 1, 2021

The issue exists in Storybook core and seems that they plan to release fix with v6.3.
I've published a patch release to fix this issue.

Do you guys can confirm that this fixes using "@nuxtjs/storybook": "^4.0.4"?

@krisimmig
Copy link

krisimmig commented Jun 2, 2021

Hi @farnabaz , it is working now for me using nuxtjs/storybook 4.0.4 and not using the plugin-proposal-private-property-in-object plugin.
👍

@hacknug
Copy link

hacknug commented Jun 2, 2021

v4.0.4 seems to have fixed the issue for me. Thanks for all the work done! 👍

@lorocher
Copy link

lorocher commented Jun 2, 2021

v4.0.4 seems to have fixed the issue for me. Thanks for all the work done! 👍

Same here, keep up the good work 👌

@visini visini closed this as completed Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests