tailwind-nextjs-starter-blog
tailwind-nextjs-starter-blog copied to clipboard
Error when creating new project using Pliny project CLI
Describe the bug
Getting ERR_MODULE_NOT_FOUND error when creating a new project using Pliny project CLI.
To Reproduce Steps to reproduce the behavior:
- Install Pliny project CLI:
npm i -g @pliny/cli - Create a new project:
pliny new --template=starter-blog my-blog - Navigate to project directory:
cd my-blog - Run
npm run devto start the development server - Go to http://localhost:3000 in browser
- See the error in CLI
Expected behavior The http://localhost:3000 should load the page normally without crashing the application.
Error trace
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/rahim/Projects/my-blog/node_modules/next/script' imported from /home/rahim/Projects/my-blog/node_modules/pliny/dist/chunk-J2TU2LAM.mjs
Did you mean to import next/script.js?
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/rahim/Projects/my-blog/node_modules/next/script' imported from /home/rahim/Projects/my-blog/node_modules/pliny/dist/chunk-J2TU2LAM.mjs
Did you mean to import next/script.js?
at new NodeError (node:internal/errors:372:5)
at finalizeResolution (node:internal/modules/esm/resolve:437:11)
at moduleResolve (node:internal/modules/esm/resolve:1009:10)
at defaultResolve (node:internal/modules/esm/resolve:1218:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:80:40)
at link (node:internal/modules/esm/module_job:78:36) {
code: 'ERR_MODULE_NOT_FOUND',
page: '/'
}
System Info (if dev / build issue):
- OS: Ubuntu 22.04.1 LTS x86_64
- Node version: 16.16.0
- Npm version: 8.11.0
Browser Info (if display / formatting issue):
- Device: Desktop
- Browser: Chrome
- Version 104.0.5112.101
Additional context
I tried removing node_modules directory and re-installing the dependencies using npm i but still got the same error.
i'm facing same error.
I tried git clone project this time, I don't get any moddule not found errors.
@plagdoctor Cloning the repo and creating a new project using npx degit both are working fine. The error I'm getting is with Pliny project CLI and since it's the recommended way, I thought of creating an issue.
Thanks for reporting. Sorry about it, will take a look at the issue over the weekends.
I have the same error.
Can confirm
Sorry it took a while to fix - there were just too many bundling, packaging issues and the combination of preact, react 18, esbuild, contentlayer, nextjs makes it more difficult than I imagine to resolve all the issues. Most of the issues should be fixed now, but do let me know if you run into any more problems.