Open shirazz opened 4 years ago
Can you add a complete reproduction?
@timneutkens Sorry for not including a reproduction demo. Please see it here https://codesandbox.io/s/muddy-cookies-9jr6z?file=/pages/index.js
Current workaround:
$ npm install --save-dev @babel/plugin-transform-unicode-regex
const presets = [
'next/babel'
];
const plugins = [
'@babel/plugin-transform-unicode-regex'
];
module.exports = {presets, plugins};
Might not be the best thing to do, but at least it fixes the issue :smile:
cc @shirazz @timneutkens
Awesome!! Let's hope a proper fix lands on a future release. Haven't got time to check in detail
Was trying this last night and got an error like below. Adding @babel/core
fixed the issue as well. @timneutkens is this an ideal way to fix this issue. Does adding @bable/core
make any unexpected impacts. Adding codesandbox URL's for your reference as well.
Codesandbox URL with error. Codesandbox URL with babel core added.
Same issue with Next@10.0.8
and Typescript.
Add @babel/plugin-transform-unicode-regex
into .babelrc
plugins has been resolved the issue.
Waiting for the next.js
core fixing.
Still occurring as of Next@10.2.3
. Adding @babel/plugin-transform-unicode-regex
resulted in e.charCodeAt is not a function
when trying to compile decamelize
.
Current workaround:
$ npm install --save-dev @babel/plugin-transform-unicode-regex
- Place it in your Babel configuration
const presets = [ 'next/babel' ]; const plugins = [ '@babel/plugin-transform-unicode-regex' ]; module.exports = {presets, plugins};
Might not be the best thing to do, but at least it fixes the issue 😄
cc @shirazz @timneutkens
This worked for me. Thanks
Current workaround:
$ npm install --save-dev @babel/plugin-transform-unicode-regex
- Place it in your Babel configuration
const presets = [ 'next/babel' ]; const plugins = [ '@babel/plugin-transform-unicode-regex' ]; module.exports = {presets, plugins};
Might not be the best thing to do, but at least it fixes the issue 😄
cc @shirazz @timneutkens
This workaround works 👍 Subscribing this issue, waiting for official fixes.
This is still an issue. Adding a custom babel config breaks builds in 14 as the current documentation doesn't explain how to extend babel config without overriding next's default settings.
This bug is happening to us on Next.js 14.2.3. Any news on a fix? Could you help us applying the workaround? Is not clear enough how to apply it.
Thank you for your time.
I just had this issue on Next.js 14.2.3 when using highlight.js
and made it work by adding the package to transpilePackages in the next config.
const nextConfig = {
transpilePackages: ["highlight.js"]
}
I keep getting this regex error.
SyntaxError: Invalid regular expression: /0[oO](([0-7]_*)+)/mu: Invalid escape
Nextjs 14.2.4 highlight.js 11.9.0
I keep getting this regex error.
SyntaxError: Invalid regular expression: /0[oO](([0-7]_*)+)/mu: Invalid escape
Nextjs 14.2.4 highlight.js 11.9.0
I have this exact error as well.
im having same issue with highlight.js
I keep getting this regex error.
SyntaxError: Invalid regular expression: /0[oO](([0-7]_*)+)/mu: Invalid escape
Nextjs 14.2.4 highlight.js 11.9.0
I just had this issue on Next.js 14.2.3 when using
highlight.js
and made it work by adding the package to transpilePackages in the next config.const nextConfig = { transpilePackages: ["highlight.js"] }
this worked
I just had this issue on Next.js 14.2.3 when using
highlight.js
and made it work by adding the package to transpilePackages in the next config.const nextConfig = { transpilePackages: ["highlight.js"] }
this worked
I had tried this but it didn't work for static export.
oh that can be the case, im not using static export
Bug report
Describe the bug
Reproduction: codesandbox.io/s/muddy-cookies-9jr6z?file=/pages/index.js
After upgrading to V 10.0.2 the ES2018
Unicode Property Escapes
feature is not working anymore. The same works perfectly till V 10.0.1 Not sure if it is due to the impact of https://github.com/vercel/next.js/pull/18759Expected behavior
Since the upgrade is not a major one, expecting the feature to work with out any issues.
System information