Importing from `contentlayer/generated` in `contentlayer.config.ts` results in `ERR_PACKAGE_PATH_NOT_EXPORTED`
See original GitHub issueHi
I’m trying to update from contentlayer 0.0.34
to 0.1.2
and I’m facing this issue. I already did all the changes mentioned in the release notes
Thanks in advance
ConfigReadError {
error: Error: Package subpath './generated' is not defined by "exports" in /Users/jahir/dev/jahir/website/node_modules/contentlayer/package.json imported from /Users/jahir/dev/jahir/website/.contentlayer/.cache/v0.1.2/compiled-contentlayer-config.mjs
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
at packageResolve (node:internal/modules/esm/resolve:873:14)
at moduleResolve (node:internal/modules/esm/resolve:929:18)
at defaultResolve (node:internal/modules/esm/resolve:1044:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
},
configPath: '/Users/jahir/dev/jahir/website/contentlayer.config.ts',
_tag: 'ConfigReadError',
toString: [Function (anonymous)],
[Symbol()]: {
error: Error: Package subpath './generated' is not defined by "exports" in /Users/jahir/dev/jahir/website/node_modules/contentlayer/package.json imported from /Users/jahir/dev/jahir/website/.contentlayer/.cache/v0.1.2/compiled-contentlayer-config.mjs
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
at packageResolve (node:internal/modules/esm/resolve:873:14)
at moduleResolve (node:internal/modules/esm/resolve:929:18)
at defaultResolve (node:internal/modules/esm/resolve:1044:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
},
configPath: '/Users/jahir/dev/jahir/website/contentlayer.config.ts'
},
[Symbol()]: [ 'configPath', 'error' ]
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Getting Started - Contentlayer
This tutorial will get you comfortable with the basics of Contentlayer by walking through how to to build a simple blog site using...
Read more >chakra-ui-docs/contentlayer.config.ts at main - GitHub
config.ts. Go to file · Go to file T
Read more >contentlayer - npm
Start using contentlayer in your project by running `npm i contentlayer`. ... Create contentlayer.config.ts file. import ...
Read more >Building Better Next.js Static Sites with MDX and Contentlayer
computedFields : derived meta data fields. contentlayer.config.ts. import { defineDocumentType, makeSource } from ' ...
Read more >How to create a Blog with Contentlayer and NextJs
Import and add contentlayer in next.config.mjs (change the ... Create a file called contentlayer.config.ts in root directory of the project ...
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
I’ve taken another look at your issue. This will be smoother with the next Contentlayer version but you can already work around it as I’ve described here for you in this video 🙂
https://cln.sh/Uypset
As mentioned in the video and above, this is actually not a Contentlayer issue itself, so I’ll close this issue for now. Please let me know in case you’re running into more problems related to this 😃
@schickling You’re right… I needed to publish an update to my website so I removed it as it was a blocker. I just created the same branch with the same changes and the same issue, if you can take a look I’d really appreciate it 🙏