-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Not allowed to load local resource - Webpack dev server error #1815
Comments
Because by default we use memory fs for speedup build, so you don't have real files, you need use option |
Just tried that didnt work. I still can't access the file input image. Same error: |
it is browser limitation, you can't use |
What if it is caused by The following works to me. {
"loader": "css-loader",
"options": {
"url": false
}
} |
@JounQin Looks like you use css-loader with Do you build library or app? |
@alexander-akait We are targeting |
@JounQin strange, can you provide reproducible example? Maybe you have own CSS/extract CSS loader? |
I'll try to add a reproduction, it's an Angular cli App with See also https://github.com/angular/angular-cli/blob/main/CHANGELOG.md#angular-devkitbuild-angular-9 |
@JounQin webpack internally replace |
In config.module.rules.push({
test: /node_modules[/\\]monaco-editor[/\\]esm[/\\].*\.css$/i,
use: [
"style-loader",
{
loader: "css-loader",
options: {
// https://github.com/webpack/webpack-dev-server/issues/1815#issuecomment-1181720815
url: false,
},
},
],
}); |
@JounQin
they output differently
and this issue metioned it webpack-contrib/css-loader#1362 , but now i'm not sure what differences between @angular-builder/custom-webpack and webpack Repro: https://github.com/yangxiaolang/css-loader-packaged-file-procotol |
@yangxiaolang Looks like angular execute CSS on Node.js side, so webpack inline @alan-agius4 can you look at this, thank you? |
Modifying the Webpack configuration is not something that we the Angular team support. Likely however this is caused because we disabled |
So |
@alan-agius4 @JounQin |
@alan-agius4 Could you tell me why it's disabled? Maybe we can solve it |
Code
Expected Behavior
Using this js
I should be able to access an image that is selected via file select. But i get
Not allowed to load local resource:
errorActual Behavior
Able to access base64 image
For Bugs; How can we reproduce the behavior?
I think the problem is to do with my webpack config
The text was updated successfully, but these errors were encountered: