Closed KillerCodeMonkey closed 1 year ago
Could you please provide a reproduction?
I can try it tomorrow. In general it is an html page loading an react app.
Devon Govett @.***> schrieb am Mi., 16. Nov. 2022, 16:57:
Could you please provide a reproduction?
— Reply to this email directly, view it on GitHub https://github.com/parcel-bundler/parcel/issues/8635#issuecomment-1317244682, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARI4YH2BMYMOCPB7ILEJ73WIUAAJANCNFSM6AAAAAASB5ZHME . You are receiving this because you authored the thread.Message ID: @.***>
@devongovett when i remove "app": "./dist/app/index.html",
it is working.
if it is not needed to link the output files that way, you can close the issue. Thank you
What are you passing as the entry point? A JS file or an HTML file? Because your config plus parcel build src/index.html
works for me.
i setup a new clean project an it is working there as well.
the entry is the .html page for serve and build.
the strange thing: when i change just out of curiosity index.html to index.js like recommended in the error. it fails as well recommending to use .html
and another funny thing: i have other target for electron-renderer defined the same way, but the target is electron-renderer and it is working. let me check a little bit further, if i can find a the root cause
So what the error is telling you is that the filetype you specified as the entry (so in parcel build src/index.js
) doesn't match the type in the package.json target (so "app": "./dist/app/index.html"
). Does that explain what you're seeing?
My question now is whether these two filetypes match up in your situation (how it should be) but you're still getting that error. If you only get this error if the filetypes don't match, then this is working as intended.
If you need both cases to work (separately), you can do this to "disable" some target where the type is wrong:
{
"app": "./dist/app/index.html",
"app-js": "./dist/index.js",
"targets": {
"app": {},
"app-js": {},
},
"scripts": {
"build": "parcel build src/index.html --target app"
"build-js": "parcel build src/index.js --target app-js"
}
}
got it.
"app": "dist/app/index.html",
"electron-renderer": "./dist/renderer/index.html"
i have two targets which are consuming and producing html files. if i add the electron-renderer it is failing for the app
seems like thats not it... so here is my full list of targets in the package.json
"app": "dist/app/index.html",
"electron-renderer": "./dist/launcher/renderer/index.html",
"electron-main": "./dist/launcher/main/main.js",
"electron-preload": "./dist/launcher/preload/preload.js",
"targets": {
"app": {
"engines": {
"browsers": "> 0.25%"
},
"context": "browser",
"isLibrary": false,
"distDir": "./dist/app"
},
"electron-preload": {
"context": "electron-main",
"distDir": "./dist/launcher/preload"
},
"electron-main": {
"context": "electron-main",
"distDir": "./dist/launcher/main"
},
"electron-renderer": {
"context": "browser",
"distDir": "./dist/launcher/renderer",
"isLibrary": false,
"publicUrl": ".",
"engines": {
"browsers": "> 0.25%"
}
}
}
when i execute
"parcel serve src/app/index.html --target app --dist-dir dist/app --port 1234 --no-cache"
it is not working with the error above.
if i remove "app": "dist/app/index.html"
, everything works.
That appears to be working for me: https://github.com/mischnic/parcel-issue-8635
i think we can close it. since it occurs in a huge project. i have not the time to investigate further and it is working on a newly created project.
sorry for the delay.
I just updated parcel from 2.7.0 to 2.8.0 and my app target is not recognized
🐛 bug report
🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
just bundles and is working as before
😯 Current Behavior
Error:
💁 Possible Solution
/
🔦 Context
Just want to update my deps
🌍 Your Environment