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.

proposal-nullish-coalescing-operator compile error

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior šŸ˜Æ

when I add loaders plugins @babel/plugin-proposal-nullish-coalescing-operator

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "useBuiltIns": "usage",
        "corejs": { "version": 3, "proposals": true }
      }
    ]
  ],
  "plugins": ["@babel/plugin-proposal-nullish-coalescing-operator"]
}

but has this error

Failed to compile.

./node_modules/react-hook-form-mui/dist/esm/index.js 36:18
Module parse failed: Unexpected token (36:18)
File was processed with these loaders:
 * ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|       return e.createElement(v, { ...a,
|         name: i,
>         value: s ?? "",
|         onChange: m,
|         onBlur: C,

Expected behavior šŸ¤”

how to fix this ā€œproposal-nullish-coalescing-operatorā€ error

Steps to reproduce šŸ•¹

Steps:

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
sjdemartinicommented, Aug 24, 2022

I tried installing and using this package within my app that used create-react-app but ran into the same Failed to compile error as the above, so Iā€™m unable to use the package. That nullish coalescing operator babel plugin is used by default in CRA (see here). Presumably this packageā€™s build needs to be compatible with that to ensure it can be used with apps created using create-react-app, though Iā€™m not familiar with the details of this.

0reactions
dohomicommented, Oct 7, 2022

good to hear, I havent used CRA for long time

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nullish coalescing operator makes package ... - GitHub
In conclusion, this means that this package is currently not compatible with webpack 4 without additional configuration because it includes theĀ ...
Read more >
babel/plugin-proposal-nullish-coalescing-operator
When true , this transform will pretend document.all does not exist, and perform loose equality checks with null instead of strict equality checks...
Read more >
nullish coalescing operator webpack/bundler issues
I've been trying to resolve this error I get. From what I can tell it's an issue with the nullish coalescing operator (??)....
Read more >
syntax error with nullish coalescing operator - Laracasts
I'm using Laravel Mix 6.0.32. I'm getting the following error when I run npm run dev: [webpack-cli] /Users/pweil/code/wisconsin-idea/webpack.mix.js:25Ā ...
Read more >
Webpack build error - Questions - Babylon.js Forum
It's the ā€œnull coalescing operatorā€ that you need to configure babel for. I wonder why Babylon doesn't target an older ES version, since...
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