railsware / bozon

🛠 Command line tool for building, testing and publishing modern Electron applications
MIT License
758 stars 52 forks source link

I updates Bozon, now nothing works anymore #59

Closed Lars- closed 4 years ago

Lars- commented 5 years ago

So, I upgrade Bozon to the latest version (0.9.2) and now nothing is working anymore. It won't compile anything anymore because a lot of foldernames changed (I fixed that) and also no node_modules are loaded it seems to only look for CSS files when I use require?

For example, this worked in a previous version: const $ = require('jquery');

Now I get this error when starting the app with bozon start:

[ ModuleNotFoundError: Module not found: Error: Can't resolve 'jquery' in '[PATH]/src/javascripts/renderer'
    at factory.create (/Users/lars/.npm-global/lib/node_modules/bozon/node_modules/webpack/lib/Compilation.js:823:10)
    at factory (/Users/lars/.npm-global/lib/node_modules/bozon/node_modules/webpack/lib/NormalModuleFactory.js:397:22)
    at resolver (/Users/lars/.npm-global/lib/node_modules/bozon/node_modules/webpack/lib/NormalModuleFactory.js:130:21)
    at asyncLib.parallel (/Users/lars/.npm-global/lib/node_modules/bozon/node_modules/webpack/lib/NormalModuleFactory.js:224:22)
    at /Users/lars/.npm-global/lib/node_modules/bozon/node_modules/neo-async/async.js:2830:7
    at /Users/lars/.npm-global/lib/node_modules/bozon/node_modules/neo-async/async.js:6877:13
    at normalResolver.resolve (/Users/lars/.npm-global/lib/node_modules/bozon/node_modules/webpack/lib/NormalModuleFactory.js:214:25)
    at doResolve (/Users/lars/.npm-global/lib/node_modules/bozon/node_modules/enhanced-resolve/lib/Resolver.js:184:12)
    at hook.callAsync (/Users/lars/.npm-global/lib/node_modules/bozon/node_modules/enhanced-resolve/lib/Resolver.js:238:5)
    at _fn0 (eval at create (/Users/lars/.npm-global/lib/node_modules/bozon/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
resolve 'jquery' in '[PATH]/src/javascripts/renderer'
  Parsed request is a module
  using description file: [PATH]/package.json (relative path: ./src/javascripts/renderer)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      looking for modules in [PATH]/src/stylesheets
        using description file: [PATH]/package.json (relative path: ./src/stylesheets)
          Field 'browser' doesn't contain a valid alias configuration
          using description file: [PATH]/package.json (relative path: ./src/stylesheets/jquery)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              [PATH]/src/stylesheets/jquery doesn't exist
            .wasm
              Field 'browser' doesn't contain a valid alias configuration
              [PATH]/src/stylesheets/jquery.wasm doesn't exist
            .mjs
              Field 'browser' doesn't contain a valid alias configuration
              [PATH]/src/stylesheets/jquery.mjs doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              [PATH]/src/stylesheets/jquery.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              [PATH]/src/stylesheets/jquery.json doesn't exist
            as directory
              [PATH]/src/stylesheets/jquery doesn't exist
      looking for modules in [PATH]/src/images
        using description file: [PATH]/package.json (relative path: ./src/images)
          Field 'browser' doesn't contain a valid alias configuration
          using description file: [PATH]/package.json (relative path: ./src/images/jquery)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              [PATH]/src/images/jquery doesn't exist
            .wasm
              Field 'browser' doesn't contain a valid alias configuration
              [PATH]/src/images/jquery.wasm doesn't exist
            .mjs
              Field 'browser' doesn't contain a valid alias configuration
              [PATH]/src/images/jquery.mjs doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              [PATH]/src/images/jquery.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              [PATH]/src/images/jquery.json doesn't exist
            as directory
              [PATH]/src/images/jquery doesn't exist ]

How do I require node_modules in the latest version?

By the way, if I don't require any node modules it starts and in the devTools I can use require('jquery') without any problems...

Thanks.

alchaplinsky commented 5 years ago

Yes, so in v0.9.0 there were a lot of braking changes: https://github.com/railsware/bozon/releases/tag/v0.9.0 So it requires some efforts to migrate projects to newer build system. As for jquery - make sure it is added to your root package.json file. Bozon now uses single package.json file, so all application dependencies should be listed there.