Closed MshHooman closed 1 year ago
@MshHooman it seems that it's not being able to compile the ??
operator? If that's really the case, you can try to use this loader: https://babeljs.io/docs/babel-plugin-proposal-nullish-coalescing-operator
I have the same issue on Nuxt 2, error points to the same line. I tried adding the babel plugin but may not be doing it correctly because it didn't work. I'll try to figure it out and update you guys here
Update: could be related to the nuxt issue: https://github.com/nuxt/nuxt/issues/6688
Update 2: indeed, using the solution from the aforementioned nuxt issue worked for me. I needed to add the following to nuxt.config
build: {
// ...
extend(config, _) {
// transpile .mjs too (see: https://github.com/nuxt/nuxt/issues/6688)
const babelRule = config.module.rules.find(
(rule) => `${rule.test}` === "/\\.jsx?$/i"
);
if (babelRule) {
babelRule.test = /\.m?jsx?$/i;
}
},
transpile: [({ isLegacy }) => isLegacy && "@lukemorales/query-key-factory"],
}
@gbyesiltas thanks for sharing the fix!
Hi,
I'm trying to use the package but faced this error when I want to start the project.
important dependencies:
plus that the project is ejected from CRA.
source code:
Error:
do you have any idea about what
loader
should I import or what makes this problem?