.parcelrc fails to extend @parcel/config-default - cannot find module
See original GitHub issue🐛 bug report
I’m getting started with parcel in a brand new project with only a few files. I want to use tsc as the default Typescript compiler so I’m following instructions posted here: https://v2.parceljs.org/languages/typescript/#typescript’s-tsc
Once I added the .pacelrc parcel no longer complies. It now fails with the following error:
Error: Cannot find module '@parcel/config-default' from 'X:\projects\boomerang'
at X:\projects\boomerang\boomerang-website\node_modules\resolve\lib\async.js:116:35
at processDirs (X:\projects\boomerang\boomerang-website\node_modules\resolve\lib\async.js:269:39)
at isdir (X:\projects\boomerang\boomerang-website\node_modules\resolve\lib\async.js:276:32)
at isDirectory (X:\projects\boomerang\boomerang-website\node_modules\@parcel\utils\lib\resolve.js:56:9) {
code: 'MODULE_NOT_FOUND'
}
🎛 Configuration (.babelrc, package.json, cli command)
.parcelrc
{
"extends": ["@parcel/config-default"],
"transformers": {
"*.{ts,tsx}": ["@parcel/transformer-typescript-tsc"]
}
}
.package.json
{
"name": "boomerang-website",
"version": "1.0.0",
"scripts": {
"prestart": "npm run clean",
"start": "npx parcel ./src/*.html",
"clean": "npx rimraf ./dist",
"prebuild": "npm run clean",
"build": "npx parcel build ./src/*.html",
"predeploy": "npm run build",
"deploy": "sls deploy -v"
},
"devDependencies": {
"parcel": "^2.0.0-beta.1",
"rimraf": "^3.0.2"
},
"dependencies": {
"serverless-cloudfront-invalidate": "^1.5.0",
"serverless-s3-sync": "^1.15.0"
}
}
🤔 Expected Behavior
Should resolve @parcel/config-default, the package exists.
😯 Current Behavior
Error: Cannot find module '@parcel/config-default' from 'X:\projects\boomerang'
at X:\projects\boomerang\boomerang-website\node_modules\resolve\lib\async.js:116:35
at processDirs (X:\projects\boomerang\boomerang-website\node_modules\resolve\lib\async.js:269:39)
at isdir (X:\projects\boomerang\boomerang-website\node_modules\resolve\lib\async.js:276:32)
at isDirectory (X:\projects\boomerang\boomerang-website\node_modules\@parcel\utils\lib\resolve.js:56:9) {
code: 'MODULE_NOT_FOUND'
}
💁 Possible Solution
🔦 Context
💻 Code Sample
🌍 Your Environment
| Software | Version(s) |
|---|---|
| Parcel | ^2.0.0-beta.1 |
| Node | v14.15.1 |
| npm/Yarn | npm@6.14.8 |
| Operating System | Windows 10 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
parcelrc fails to extend @parcel/config-default - cannot find ...
bug report. I'm getting started with parcel in a brand new project with only a few files. I want to use tsc as...
Read more >Dependency resolution - Parcel
Parcel implements an enhanced version of the Node module resolution algorithm. It is responsible for turning a dependency specifier into an absolute path ......
Read more >@parcel/config-default NPM | npm.io
Automatically transforms modules using Babel, PostCSS, and PostHTML when needed - even node_modules . ✂️ Zero configuration code splitting using dynamic ...
Read more >parcel/core: Failed to resolve 'index.html' Getting this error
Generally, you'll want to add your custom resolvers before running the default ones. { "extends": "@parcel/config-default", "resolvers": [" ...
Read more >Plugin Configuration - Parcel
A common usecase is extending the default config, for this reason the extends field can be a config package or an array of...
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 Free
Top 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

Make sure that
parcel,@parcel/config-defaultand@parcel/validator-typescriptare all on the same (or latest) nightly version.Yes, for example Yarn PnP would throw an error if you don’t list it in the dependencies. But I’m not quite sure how to put that into the docs without adding a note to every blue “example” block with a .parcelrc (or maybe that’s fine?)
You should install @parcel/config-default and @parcel/transformer-typescript-tsc as dependencies