Comments (3)
@kreker92 react-static needs react-hot-loader as a peer-dependency, which means you have to install it in your project
from react-static.
Try to FIX
I've tried to update react-static version
In package.json
I've changed
"react-static": "^^7.5.1",
"react-static-plugin-reach-router": "^^7.5.1",
"react-static-plugin-sitemap": "^^7.5.1",
"react-static-plugin-source-filesystem": "^^7.5.1",
"react-static-plugin-typescript": "^^7.5.1"
To
"react-static": "^7.6.2",
"react-static-plugin-reach-router": "^7.6.2",
"react-static-plugin-sitemap": "^7.6.2",
"react-static-plugin-source-filesystem": "^7.6.2",
"react-static-plugin-typescript": "^7.6.2"
Environment
System:
OS: macOS 11.6
CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
Memory: 879.74 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.17.6 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 7.24.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Browsers:
Chrome: 92.0.4515.131
Firefox: 94.0.1
Safari: 15.0
npmPackages:
react: ^16.14.0 => 16.14.0
react-dom: ^16.14.0 => 16.14.0
react-hot-loader: ^4.13.0 => 4.13.0
react-static: ^7.6.2 => 7.6.2
react-static-plugin-reach-router: ^7.6.2 => 7.6.2
react-static-plugin-sitemap: ^7.6.2 => 7.6.2
react-static-plugin-source-filesystem: ^7.6.2 => 7.6.2
react-static-plugin-typescript: ^7.6.2 => 7.6.2
npmGlobalPackages:
react-static: 7.6.2
Bug
But still have the same error
$ react-static bundle --analyze
Bundling application for Production...
Cleaning dist...
[✓] Dist cleaned (0.8s)
Cleaning artifacts...
[✓] Artifacts cleaned
Building Routes...
Importing routes from directory...
{ has404: true }
[✓] Routes Built (0.3s)
Building Templates...
[✓] Templates Built (0.1s)
Copying public directory...
[✓] Public directory copied (1s)
Bundling App...
Error parsing bundle asset "/Users/viktorzaytsev/work/web_test/dist/main.fef6307a.js": no such file
No bundles were parsed. Analyzer will show only original module sizes from stats file.
Webpack Bundle Analyzer is started at http://127.0.0.1:8888
Use Ctrl+C to close it
Version: webpack 4.46.0
Time: 18775ms
Built at: 24.11.2021 16:49:46
Asset Size Chunks Chunk Names
main.fef6307a.js 1.43 KiB 0 [immutable] main
[0] multi ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js ../lib/bootstrapApp.js 52 bytes {0} [built]
ERROR in multi ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js ../lib/bootstrapApp.js
Module not found: Error: Can't resolve 'react-hot-loader/webpack' in '/Users/viktorzaytsev/.config/yarn/global/node_modules/react-static/node_modules'
@ multi ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js ../lib/bootstrapApp.js main[0]
ERROR in multi ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js ../lib/bootstrapApp.js
Module not found: Error: Can't resolve 'react-hot-loader/webpack' in '/Users/viktorzaytsev/.config/yarn/global/node_modules/react-static/node_modules'
@ multi ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js ../lib/bootstrapApp.js main[1]
ERROR in multi ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js ../lib/bootstrapApp.js
Module not found: Error: Can't resolve 'react-hot-loader/webpack' in '/Users/viktorzaytsev/.config/yarn/global/node_modules/react-static/node_modules'
@ multi ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js ../lib/bootstrapApp.js main[2]
=> There were ERRORS during the prod build stage! :(
=> Fix them and try again!
Version: webpack 4.46.0
Time: 19229ms
Built at: 24.11.2021 16:49:46
Asset Size Chunks Chunk Names
static-app.js 4.58 KiB 0 main
[0] multi ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js ../lib/bootstrapApp.js 52 bytes {0} [built]
ERROR in multi ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js ../lib/bootstrapApp.js
Module not found: Error: Can't resolve 'react-hot-loader/webpack' in '/Users/viktorzaytsev/.config/yarn/global/node_modules/react-static/node_modules'
@ multi ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js ../lib/bootstrapApp.js main[0]
ERROR in multi ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js ../lib/bootstrapApp.js
Module not found: Error: Can't resolve 'react-hot-loader/webpack' in '/Users/viktorzaytsev/.config/yarn/global/node_modules/react-static/node_modules'
@ multi ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js ../lib/bootstrapApp.js main[1]
ERROR in multi ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js ../lib/bootstrapApp.js
Module not found: Error: Can't resolve 'react-hot-loader/webpack' in '/Users/viktorzaytsev/.config/yarn/global/node_modules/react-static/node_modules'
@ multi ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js ../lib/bootstrapApp.js main[2]
=> There were ERRORS during the node build stage! :(
=> Fix them and try again!
[✓] App Bundled (24.3s)
from react-static.
FIX
$ yarn global add react-hot-loader
from react-static.
Related Issues (20)
- Partial SSG/preRender HOT 4
- use localStorage HOT 1
- [Bug] Why `window?.xxx?.xxx` fails on build? HOT 1
- [Bug] Build fails for basic template
- [Bug] basePath unable to use HOT 7
- [Bug] Sitemap is generated with template path instead of actual path
- [Bug] React-static renders a blank route for split-second after page load
- [Bug] long time for "Bundle updating"
- When using BrowerRouter in App. The npm run build fails, but npm run start works fine HOT 1
- [Bug] Build fails due to "babel-plugin-universal-import/universalImport" MODULE_NOT_FOUND HOT 2
- redux: "Cannot read property 'store' of null" on build
- [Docs] Internationalized html files (for SEO)? HOT 2
- [Bug] deterministic builds HOT 2
- Support for Yarn 2 HOT 1
- create-react-app build The static resource folder path is incorrect
- [Bug] QueryString not working in production - window.location.search empty
- [Help] Dynamic Routes with statically generated data HOT 2
- Please do not open new issues
- Can't resolve 'react-hot-loader/webpack' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-static.