TypeError: Cannot read properties of undefined (reading 'replace')
See original GitHub issueVersions
- next: 13.0.0
- next-with-less: 2.0.5
- less-loader: 11.1.0
- less: 4.1.3
- antd: 4.24.4
next.config.js
const withLess = require("next-with-less");
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
lessLoaderOptions: {}
}
module.exports = withLess(nextConfig)
Error Message
TypeError: Cannot read properties of undefined (reading 'replace')
at addLessToRegExp (/project/sandbox/node_modules/next-with-less/dist/index.js:21:31)
at addLessToRuleTest (/project/sandbox/node_modules/next-with-less/dist/index.js:77:18)
at /project/sandbox/node_modules/next-with-less/dist/index.js:87:23
at Array.forEach (<anonymous>)
at Object.webpack (/project/sandbox/node_modules/next-with-less/dist/index.js:81:21)
at Object.getBaseWebpackConfig [as default] (/project/sandbox/node_modules/next/dist/build/webpack-config.js:1413:32)
at async Promise.all (index 0)
at async Span.traceAsyncFn (/project/sandbox/node_modules/next/dist/trace/trace.js:79:20)
at async Span.traceAsyncFn (/project/sandbox/node_modules/next/dist/trace/trace.js:79:20)
at async HotReloader.start (/project/sandbox/node_modules/next/dist/server/dev/hot-reloader.js:332:30)
Examples
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Uncaught TypeError: Cannot read properties of undefined ...
In your example Uncaught TypeError: Cannot read properties of undefined (reading 'replace' ) can occur only if your variables song and/or ...
Read more >[SOLVED] Cannot Read Property 'replace' of Undefined in JS
To fix the “cannot read property 'replace' of undefined” error, perform an undefined check on the variable before calling the replace() method ......
Read more >TypeError: Cannot read property 'replace' of Undefined in JS
The "Cannot read property 'replace' of undefined" error occurs when calling the replace() method on an undefined value. To solve the error, provide...
Read more >Cannot read property 'replace' of Undefined in JS - Isotropic
This can be very useful but sometimes runtime errors may come up while using this method such as TypeError: Cannot read properties of...
Read more >Error in render: "TypeError: Cannot read property 'replace' of ...
This is the error got: Error in render: "TypeError: Cannot read property 'replace' of undefined". Note: I'm using ElementUI for uploading the image....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
AntD since 5.0 doesn’t use less. You can use this guide to migrate: https://ant.design/docs/react/migration-v5
The error message shows up after installing @next/font with Next.js 13