bhauman / figwheel-main

Figwheel Main provides tooling for developing ClojureScript applications
https://figwheel.org
Eclipse Public License 1.0
640 stars 93 forks source link

Webpack bundling fails #306

Closed trugrammar closed 3 years ago

trugrammar commented 3 years ago

So I cannot integrate npm with figwheel as in the tutorial. I am building with clj on windows. I can run npx webpack .... from the command line manually and get the bundling to work. However when figwheel attempts to do this, webpack cannot seem to find files.

With :auto-bundle :webpack in dev.cljs.edn, I get the following output when it tries to bundle:

[Figwheel:SEVERE] ←[31mBundling command failed asset ←[1m←[32mmain_bundle.js←[39m←[22m 662 bytes ←[1m←[33m[compared for emit]←[39m←[22m (name: main)

←[1m←[31mERROR←[39m←[22m in ←[1m←[32mmain←[39m←[22m ←[1mModule ←[1m←[31mnot found←[39m←[22m←[1m: ←[1m←[31mError←[39m←[22m←[1m: Can't resolve '.\target\public\cljs-out\dev\main.js' in 'C:\Users\trim5\Documents\Repositories\ExerciseCreationTool' ←[1m←[32mDid you mean './.\target\public\cljs-out\dev\main.js'?←[39m←[22m←[1m Requests that should resolve in the current directory need to start with './'. Requests that start with a name are treated as module requests and resolve within module directories (node_modules). If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.←[39m←[22m resolve '.\target\public\cljs-out\dev\main.js' in 'C:\Users\trim5\Documents\Repositories\ExerciseCreationTool' Parsed request is a module using description file: C:\Users\trim5\Documents\Repositories\ExerciseCreationTool\package.json (relative path: .) Field 'browser' doesn't contain a valid alias configuration resolve as module looking for modules in C:\Users\trim5\Documents\Repositories\ExerciseCreationTool\node_modules single file module using description file: C:\Users\trim5\Documents\Repositories\ExerciseCreationTool\package.json (relative path: ./node_modules/target/public/cljs-out/dev/main.js) no extension Field 'browser' doesn't contain a valid alias configuration ←[1m←[31mC:\Users\trim5\Documents\Repositories\ExerciseCreationTool\node_modules\target\public\cljs-out\dev\main.js doesn't exist←[39m←[22m .js Field 'browser' doesn't contain a valid alias configuration ←[1m←[31mC:\Users\trim5\Documents\Repositories\ExerciseCreationTool\node_modules\target\public\cljs-out\dev\main.js.js doesn't exist←[39m←[22m .json Field 'browser' doesn't contain a valid alias configuration ←[1m←[31mC:\Users\trim5\Documents\Repositories\ExerciseCreationTool\node_modules\target\public\cljs-out\dev\main.js.json doesn't exist←[39m←[22m .wasm Field 'browser' doesn't contain a valid alias configuration ←[1m←[31mC:\Users\trim5\Documents\Repositories\ExerciseCreationTool\node_modules\target\public\cljs-out\dev\main.js.wasm doesn't exist←[39m←[22m ←[1m←[31mC:\Users\trim5\Documents\Repositories\ExerciseCreationTool\node_modules\target\public\cljs-out\dev\main.js doesn't exist←[39m←[22m ←[1m←[31mC:\Users\trim5\Documents\Repositories\node_modules doesn't exist←[39m←[22m or is not a directory ←[1m←[31mC:\Users\trim5\Documents\node_modules doesn't exist←[39m←[22m or is not a directory ←[1m←[31mC:\Users\trim5\node_modules doesn't exist←[39m←[22m or is not a directory ←[1m←[31mC:\Users\node_modules doesn't exist←[39m←[22m or is not a directory ←[1m←[31mC:\node_modules doesn't exist←[39m←[22m or is not a directory

webpack 5.59.1 compiled with ←[1m←[31m1 error←[39m←[22m in 49 ms ←[0m

These are my versions: {:deps {org.clojure/clojure {:mvn/version "1.10.1"} org.clojure/clojurescript {:mvn/version "1.10.773"} com.bhauman/figwheel-main {:mvn/version "0.2.14"} com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"} binaryage/devtools {:mvn/version "1.0.4"} reagent {:mvn/version "1.1.0" :exclusions [cljsjs/react cljsjs/react-dom]} cljsjs/react {:mvn/version "16.13.1-0"} cljsjs/react-dom {:mvn/version "16.13.1-0"}}