New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parcel 2: @parcel/transformer-raw problems #4174
Comments
|
The result is exactly the same with |
Use any name for the target except main, browser or module. |
I've tried again using this config {
"name": "parcel-raw-transform",
"version": "0.0.1",
"license": "MIT",
"devDependencies": {
"parcel": "^2.0.0-nightly.116"
},
"scripts": {
"dev": "parcel src/index.html --target=appModern"
},
"appModern": "dist/browserModern/index.html",
"targets": {
"appModern": {
"engines": {
"browsers": ["last 1 chrome version"]
}
}
}
}
the build in import './foo.ts'
console.log('foo') and now in addition, even though the logs says
If i remove - Refused to execute script from 'http://localhost:1234/parcel-test.d7ebec59.ts' because its MIME type ('video/mp2t') is not executable. because the served html file points to a import './foo.ts'
console.log('foo') |
The problem happens most of the time when there's a {
"extends": "@parcel/config-default",
"transforms": {
- "url:*": ["@parcel/transformer-raw"] // throws
- "url:*.*": ["@parcel/transformer-raw"] // throws
+ "url:*foo.*": ["@parcel/transformer-raw"] // ok
+ "urlfoo:*": ["@parcel/transformer-raw"] // ok
+ "url:a:*": ["@parcel/transformer-raw"] // ok
+ // ect...
}
} |
Indeed, it seems like the ts import is matched with |
The problem also happen on js files but differently, with js files the bundle actually gets built, but the JS asset is still raw. // ...
})({"238cc7072f28c30752fc1f1e9056221e":[function(require,module,exports) {
import './foo.js'
console.log('foo')
},{}],"d347dc37b6ca23899ffbbc32fd87b43f":[function(require,module,exports) {
// ... |
Any starting points/guidance on how to try to fix it ? |
Quite sure the bug is in here: parcel/packages/core/core/src/ResolverRunner.js Lines 64 to 100 in 706a7e6
At the end |
I tried fixing it, made a PR, but all tests are failing and i can't even run |
Actually, the error seems to be somewhere else, because {
"extends": "@parcel/config-default",
"transforms": {
"url:*": ["@parcel/transformer-raw"]
}
} should really do nothing (this is already specified in the default config). |
I mean, the PR i made fixed the repo build & properly transpiled the But yeah, if it's specified by default there's a problem somewhere else. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I think this should be fixed by #6495 which runs transformers from the next matching pipeline before the url transformer. |
🐛 bug report
https://github.com/Banou26/parcel-bug-4174
When using this configuration as per #1080 (comment) and #501 (comment)
.parcelrc
The end build isn't transpiled at all, for example in the repro, the
index.html
importsindex.ts
which containsand the output build Parcel serves is
/parcel-test.d7ebec59.ts
🎛 Configuration (.babelrc, package.json, cli command)
.parcelrc
package.json
I tried with both the
2.0.0-alpha.3.2
and2.0.0-nightly.116
The text was updated successfully, but these errors were encountered: