webpack-isomorphic-tools: "asset not found" Error while file is present in webpack-assets.json
Hi,
I came across this issue and I am not sure if it’s due to the unusual folder structure of my project or if it’s a bug from webpack-isomorphic-tools.
The issue can be reproduced on https://github.com/happypoulp/webpack-isomorphic/tree/issue-production
After running npm run webpack
if you run npm start
to start the application server, you’ll see errors being emitted by webpack-isomorphic tools about some assets not being found.
Here is the debug output:
.local ~/Codes/webpack-iso > npm start
> webpack-iso@1.0.0 start /Users/fbonnefont/Codes/webpack-iso
> NODE_ENV=dev node app/bin/server.js
[webpack-isomorphic-tools] [debug] instantiated webpack-isomorphic-tools with options {
"debug": true,
"assets": {
"json": {
"extensions": [
"json"
]
},
"scss": {
"extensions": [
"scss"
]
}
},
"webpack_assets_file_path": "webpack-assets.json",
"webpack_stats_file_path": "webpack-stats.json"
}
[webpack-isomorphic-tools] [debug] entering development mode
[webpack-isomorphic-tools] [debug] registering require() hooks for assets
[webpack-isomorphic-tools] [debug] registering a require() hook for *.json
[require-hook] [debug] Hooking into *.json files loading
[require-hook] [debug] -----------------------------------------------
[require-hook] [debug] Overriding an already existing require() hook
[require-hook] [debug] for file extension .json
[require-hook] [debug] -----------------------------------------------
[webpack-isomorphic-tools] [debug] registering a require() hook for *.scss
[require-hook] [debug] Hooking into *.scss files loading
FAKE SERVER
[webpack-isomorphic-tools] [debug] flushing require() caches
[require-hook] [debug] require() hook fired for /Users/fbonnefont/Codes/webpack-iso/app/src/base.scss
[webpack-isomorphic-tools] [debug] require() called for /Users/fbonnefont/Codes/webpack-iso/app/src/base.scss
[webpack-isomorphic-tools] [debug] requiring ./src/base.scss
[require-hook] [debug] require() hook fired for /Users/fbonnefont/Codes/webpack-iso/app/webpack-assets.json
[require-hook] [debug] Fallback to original loader
[webpack-isomorphic-tools] [error] asset not found: ./src/base.scss
[require-hook] [debug] require() hook fired for /Users/fbonnefont/Codes/webpack-iso/app/src/mod-1.scss
[webpack-isomorphic-tools] [debug] require() called for /Users/fbonnefont/Codes/webpack-iso/app/src/mod-1.scss
[webpack-isomorphic-tools] [debug] requiring ./src/mod-1.scss
[webpack-isomorphic-tools] [error] asset not found: ./src/mod-1.scss
[require-hook] [debug] require() hook fired for /Users/fbonnefont/Codes/webpack-iso/app/src/file.json
[webpack-isomorphic-tools] [debug] require() called for /Users/fbonnefont/Codes/webpack-iso/app/src/file.json
[webpack-isomorphic-tools] [debug] requiring ./src/file.json
[webpack-isomorphic-tools] [error] asset not found: ./src/file.json
...
What puzzles me is that for example ./src/base.scss
is actually present in webpack-assets.json but under the path ./app/src/base.scss
… The project_base_path I gave to webpack-isomorphic-tools server is the same as the one used in my webpack.config.js as suggested in your docs but I think that the issue might come from that setup.
Do you know what the issue could come from?
Thanks!
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 18 (10 by maintainers)
Commits related to this issue
- fixes #40 — committed to catamphetamine/webpack-isomorphic-tools by catamphetamine 9 years ago
I know this library is deprecated and I can’t tell if this is the same issue, but after upgrading to Webpack 4 I’m getting lots of
repeated for all of my css imports
and a huge stack trace starting with: