-
-
Notifications
You must be signed in to change notification settings - Fork 38
Error: export 'getHighlighterCore' (reexported as 'getHighlighterCore') was not found in './core.mjs' (module has no exports) #13
Comments
Would certainly be happy to see a minimal reproduction, it's working fine for me. |
Here ya go. Thanks again for your help! Note that I produced this example by...
|
Seems to working fine on https://stackblitz.com/~/github.com/ben519/shikiji-test |
I posted about this on StackOverflow in case you're interested in following. One thing that did come up is the difference in node versions. I'm using v19.4.0 locally but it looks like StackBlitz is using v16.20.0. |
Any reasons you are not using a LTS version of Node? Did tried with another Node versions? |
No particular reason. I just tried installing and using Node 16 with
Same error, unfortunately. |
Interestingly enough, if I run the |
I guess the issue is probably more on the next side. I am closing it here as it's not clear what we can do on our side. Thanks |
For anyone else coming across this issue in the future, it appears that Next.js does not load You can modify Next.js' Webpack configuration to support // next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: function (config) {
config.module.rules.push({
test: /\.m?js$/,
type: "javascript/auto",
resolve: {
fullySpecified: false,
},
});
return config;
},
};
module.exports = nextConfig; Source: vercel/next.js#17806 The equivalent configuration change in apps using Turbopack is unknown (maybe it's not even needed?). |
This worked, thank you! Had the same problem. |
i got this error in next.js 14 while using |
For Next.js users: vercel/next.js#58967 has been merged, so from Next.js v14.0.4-canary.33 it's possible to use |
I am personally having trouble with the Edit* I am not using nextjs |
|
You can use import() in CJS to import shikiji as documented. Please do not comment in a closed issue. Create a new one with proper reproduction instead. Thanks. |
Describe the bug
Firstly, thanks for your work on shikiji! It solves a very real pain point with shiki, and I'm excited to see the project continue.
I'm developing a project with Next.js 13 (app dir) and I'm running into the following error
The mere act of importing shikiji causes the error
Note that I installed shikiji with
npm install shikiji
and it's listed in mypackage.json
file as"shikiji": "^0.6.3"
Reproduction
(Will produce if necessary)
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: