[v2] bad error message for package.json#main mismatch with html entry point: "Destination name index.js extension does not match bundle type "html"
See original GitHub issue🐛 bug report
parcel build
is broken. if you take the basic index.html/styles.css setup in the readme: https://github.com/parcel-bundler/parcel/tree/v2#getting-started
you can run parcel index.html
fine, but when you run parcel build
you get the above mentioned error
🎛 Configuration (.babelrc, package.json, cli command)
{
"name": "netlify-drop-demo-site-master",
"version": "1.0.0",
"main": "index.js",
"repository": "https://github.com/sw-yx/netlify-drop-demo-site-master.git",
"author": "sw-yx <swyx@dontemail.me>",
"license": "MIT",
"devDependencies": {
"parcel": "^2.0.0-alpha.1.1"
},
"scripts": {
"build": "parcel build basic.html"
},
"dependencies": {
"react": "^16.9.0",
"react-dom": "^16.9.0"
}
}
🤔 Expected Behavior
it should build
😯 Current Behavior
doesnt build
yarn run v1.17.0
$ /Users/swyx/Downloads/netlify-drop-demo-site-master/node_modules/.bin/parcel build basic.html
🚨 Destination name index.js extension does not match bundle type "html"
at BundlerRunner.nameBundle (/Users/swyx/Downloads/netlify-drop-demo-site-master/node_modules/
@parcel/core/lib/BundlerRunner.js:137:17)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
💁 Possible Solution
no idea
🔦 Context
just trying to try out parcel v2
🌍 Your Environment
Software | Version(s) |
---|---|
Parcel | 2.0.0-alpha.1.1 |
Node | 10.13 |
npm/Yarn | 6.51/1.17 |
Operating System | osx latest |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:18 (8 by maintainers)
Top Results From Across the Web
Where should the path from main in package.json point to?
@parcel/namer-default: Target "main" declares an output file path of "src/index.js" which does not match the compiled bundle type "html". .../ ...
Read more >package.json - npm Docs
Description. This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just...
Read more >Main entry point does not exist - Cyclic Documentation
If you get an error in the deploy log that says that your package.json points to a file that does not exist, here...
Read more >@parcel/fs NPM | npm.io
html file, they won't be merged together. Bundle Name, Assets, Entry URL. index.html, index.html, /.
Read more >NetSuite Applications Suite - The distro.json and ns.package ...
Choosing an Intrastat Declaration Type · Region of Origin and Destination ... Create Your CCT as an Extension · Create the Entry Point...
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
I think could be related to your
package.json#main
. It uses that to define the output files and your entry is anhtml
file, but yourmain
is expected it to output as ajs
file. Try updating yourmain
todist/index.html
https://v2.parceljs.org/features/targets/#library-targets: