Comments (11)
you did run the npm ci
command to install all the correct modules?
Normally npm run build
would create this index.html.gz
file. When I comment the last two lines of webpack.config.js
to prevent deletion of the build artefacts, I get a dist folder with the files bundle.js
, bundle.js.gz
and index.html.gz
. The reason this file is created in a gzipped version is because of the CompressionPlugin()
in the webpack config.
Do you get any files in your dist folder at all? And how does your command line output look preceding the error message?
from esp8266-iot-framework.
Thanks for the speedy response, most appreciated.
I have run npm ci
, and it gave an error I corrected using the suggested --legacy-peer-deps
.
Here's the output from npm ci
➜ ESP8266 IoT Framework git:(master) ✗ npm ci
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: [email protected]
npm ERR! node_modules/compression-webpack-plugin
npm ERR! dev compression-webpack-plugin@"^3.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev compression-webpack-plugin@"^3.1.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/patrick/.npm/eresolve-report.txt for a full report.
The output from npm run build
(after running npm ci --legacy-peer-deps
) is:
[email protected] build
webpack --mode=production
Doing webby stuff
Error: ENOENT: no such file or directory, open './dist/index.html.gz'
at Object.openSync (node:fs:476:3)
at Object.readFileSync (node:fs:377:35)
at done (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/webpack.config.js:110:37)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/tapable/lib/HookCodeFactory.js:33:10), :18:1)
at AsyncSeriesHook.lazyCompileHook (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/tapable/lib/Hook.js:154:20)
at onCompiled (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/webpack/lib/Compiler.js:271:21)
at /Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/webpack/lib/Compiler.js:681:15
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/tapable/lib/Hook.js:154:20)
at /Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/webpack/lib/Compiler.js:678:31
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/tapable/lib/Hook.js:154:20)
at /Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/webpack/lib/Compilation.js:1423:35
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/tapable/lib/Hook.js:154:20)
at /Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/webpack/lib/Compilation.js:1414:32
at eval (eval at create (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/tapable/lib/HookCodeFactory.js:33:10), :11:1)
at /Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/terser-webpack-plugin/dist/index.js:321:9
at step (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/terser-webpack-plugin/dist/TaskRunner.js:87:9)
at /Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/terser-webpack-plugin/dist/TaskRunner.js:111:15
at tryCatcher (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:729:18)
at Promise._fulfill (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:673:18)
at Promise._resolveCallback (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:466:57)
at Promise._settlePromiseFromHandler (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:559:17)
at Promise._settlePromise (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:729:18)
at Promise._fulfill (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:673:18)
at Promise._resolveCallback (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:466:57)
at Promise._settlePromiseFromHandler (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:559:17)
at Promise._settlePromise (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework/node_modules/bluebird/js/release/promise.js:649:10)
npm ERR! code 1
npm ERR! path /Users/patrick/Documents/PlatformIO/Projects/PROJECTNAME/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework
npm ERR! command failed
npm ERR! command sh -c webpack --mode=production
The dist
directory is empty. Doing webby stuff
is a console log line I added to webpack.config.js on line 103 to check the production html code stuff is really running.
Many thanks for any insights you can give!
from esp8266-iot-framework.
Can you remove the node_modules folder, and retry with npm install
instead of npm ci
?
from esp8266-iot-framework.
I removed node_modules, and re-ran as above - legacy flag required again, same output as above.
I switched to a Ubuntu machine, and tried to compile one of the examples - it works, but there is an error from Sconscript:
Missing Sconcript
.pio/libdeps/nodemcu2v/ESP8266 IoT Framework/build/preBuild.py
And indeed, the build
directory is missing, along with docs
-- platformio doesn't seem to install them. This is with vscode 1.50.1 and platformio 2.1.3
So I think there's something wrong with the brew/npm environment on the Mac, and platformio behaves differently between mac and linux platforms resulting in a broken build under linux? I will experiment further with the linux environment to see if I can hack a build that correctly applies preBuild.py
from esp8266-iot-framework.
Ha! I think I have made some progress. The root cause of the problem may lie in the use of spaces within the library name "ESP8266 IoT Framework". Creating a symbolic link from ESP8266 IoT Framework
to ESP8266_IoT_Framework
and adding the build flag DPROJECT_DIR=/home/patrick/Documents/Arduino/iot_test2/.pio/libdeps/nodemcuv2/ESP8266_IoT_Framework/build
to platformio.ini
gets significantly further in the build process, failing with:
ERROR in Entry module not found: Error: Can't resolve './src' in '/home/patrick/Documents/Arduino/iot_test2/.pio/libdeps/nodemcuv2/ESP8266 IoT Framework'
which does of course exist, but needs presumably to be correctly escaped to handle the spaces. Is that a major re-factor?
from esp8266-iot-framework.
Sorry, for all the issues you are facing, and thanks for your patience. To make sure it is due to the space in the library name:
Can you try to:
- Clone this repository to your computer
- Take one of the example .c files and add it to the src folder
- Do a build
In this case you use the project as a main project, and not as a platformio library. This should remove the spaces in your path. There is also work ongoing to make this library compatible with the ESP32 after which a name change will be needed anyway. At this point I will also remove the spaces from the name if this indeed causes the issue on mac :).
As for you linux machine. If your platformio version is really 2.1.3 you should upgrade, that seems like quite an old version. Hopefully this will resolve the missing library folders.
from esp8266-iot-framework.
Success - under Ubuntu:
- Create empty VScode platformio project
- cd lib
- git clone https://github.com/maakbaas/esp8266-iot-framework.git
- cd esp8266-iot-framework
- npm ci
- cd .. (back to lib dir again) - add dependencies
- git clone https://github.com/me-no-dev/ESPAsyncWebServer.git
- git clone https://github.com/me-no-dev/ESPAsyncTCP.git
- git clone https://github.com/bblanchon/ArduinoJson.git
- cp esp8266-iot-framework/examples/helloWorld.cpp ../../../src
- Verify helloWorld build succeeds
- To customise web config, add iot_config.json to src directory and add
build_flags = -DCONFIG_PATH=src/iot_config.json -DREBUILD_HTML
to platformio.ini and rebuild should proceed without error
PS. Given that .pio isn't under source control by default, and github libraries do come and go over time, I think this method is to be preferred over the use of lib_deps because the code can be rebuilt from just the local git repo if required?
Feel free to reuse any of above as you may wish, many thanks for the help.
from esp8266-iot-framework.
Glad that you got it working. Although in this way you lose some of the convenience benefits of PlatformIO of course ;).
PlatformIO is actually there to do the configuration management, but indeed with your method you have everything fully local and you can employ your own strategies for managing the libraries.
from esp8266-iot-framework.
I removed node_modules, and re-ran as above - legacy flag required again, same output as above.
I switched to a Ubuntu machine, and tried to compile one of the examples - it works, but there is an error from Sconscript:
Missing Sconcript
.pio/libdeps/nodemcu2v/ESP8266 IoT Framework/build/preBuild.py
And indeed, the
build
directory is missing, along withdocs
-- platformio doesn't seem to install them. This is with vscode 1.50.1 and platformio 2.1.3So I think there's something wrong with the brew/npm environment on the Mac, and platformio behaves differently between mac and linux platforms resulting in a broken build under linux? I will experiment further with the linux environment to see if I can hack a build that correctly applies preBuild.py
I ran into this same issue, maybe something changes in the way PlatformIO downloads dependencies. I will reopen this issue and investigate.
from esp8266-iot-framework.
See this discussion: platformio/platformio-core#3730
from esp8266-iot-framework.
fixed in 9d36648
from esp8266-iot-framework.
Related Issues (20)
- Holding connections open for long periods of time HOT 4
- Event on Dashboard Change HOT 12
- Detect if captive portal is running and WiFi is in Ad-hoc mode HOT 3
- Separator and titol in config page HOT 1
- Enhancement: Adding "label" in dashboard HOT 4
- mDNS not working HOT 1
- Error when run "npm ci" HOT 7
- Failing at Step 9. HOT 3
- WiFi passwords including "+" not working HOT 3
- 403 Forbidden response to GET request HOT 1
- Dependency issues in library HOT 4
- Request: click button in dashboard HOT 1
- WIFI reconnect HOT 1
- The cipher AES128-SHA is not supported for TLSv1.2. HOT 5
- Import issue Arduino IDE 2.1.1 HOT 3
- html.h not being rebuild HOT 1
- ssl.wrap_socket() gots removed within python 3.12
- Json name with spaces HOT 1
- Missing dependancy HOT 1
- Upload empty file failes HOT 1
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 esp8266-iot-framework.