Open RobotSail opened 1 year ago
@RobotSail
import removeImports from 'next-remove-imports'
const removeImportsFun = removeImports({
options: { },
})
export default removeImportsFun({
reactStrictMode: true,
i18n: {
locales: ["en"],
defaultLocale: "en",
},
})
@jaywcjlove Thanks! I tried using CodeEditor
with the above configuration but am still running into the following error:
Error: require() of ES Module /Users/osilkin/Programming/main/autoreviewer-2/node_modules/rehype/index.js from /Users/osilkin/Programming/main/autoreviewer-2/node_modules/@uiw/react-textarea-code-editor/cjs/utils.js not supported.
Instead change the require of index.js in /Users/osilkin/Programming/main/autoreviewer-2/node_modules/@uiw/react-textarea-code-editor/cjs/utils.js to a dynamic import() which is available in all CommonJS modules.
In case of Next.js, adding experimental.esmExternals: 'loose'
fixes the issue.
I'm trying to use this with a
next.config.mjs
file and am probably using this incorrectly. The issue I'm running into is that there is no place for me to pass my existingNextConfig
as an argument intoremoveImports
, since the signature looks like:I've tried instead to merge the output from
removeImports
with my initialized config, but that didn't seem to have any effect:This must be the case of me doing something incorrectly, but it's blocking my ability to use this package.