aurelia / webpack-plugin

A plugin for webpack that enables bundling Aurelia applications.
MIT License
90 stars 36 forks source link

Error: Unable to find module with ID: aurelia-pal-browser #182

Closed ItWorksOnMyMachine closed 3 years ago

ItWorksOnMyMachine commented 3 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior: When building using Typescript and Webpack I get the following two warnings below. No errors, however when browsing to the site I get the following error in the devtools console window "Error: Unable to find module with ID: aurelia-pal-browser"

WARNING in ./node_modules/aurelia-pal-nodejs/dist/index.js 86:39-56 Critical dependency: the request of a dependency is an expression @ ./node_modules/aurelia-bootstrapper/dist/native-modules/aurelia-bootstrapper.js

WARNING in ./node_modules/express/lib/view.js 81:13-25 Critical dependency: the request of a dependency is an expression @ ./node_modules/express/lib/application.js 22:11-28 @ ./node_modules/express/lib/express.js 18:12-36 @ ./node_modules/express/index.js 11:0-41 @ ./node_modules/net-browserify/api.js 4:14-32 @ ./node_modules/forever-agent/index.js 6:10-24 @ ./node_modules/request/request.js 14:19-43 @ ./node_modules/request/index.js 143:18-38 @ ./node_modules/jsdom/lib/jsdom/living/helpers/wrap-cookie-jar-for-request.js 2:16-34 @ ./node_modules/jsdom/lib/jsdom/browser/resources/resource-loader.js 6:32-91 @ ./node_modules/jsdom/lib/api.js 16:23-78 @ ./node_modules/aurelia-pal-nodejs/dist/nodejs-pal-builder.js 6:16-32 @ ./node_modules/aurelia-pal-nodejs/dist/index.js 5:29-60 6:27-58 @ ./node_modules/aurelia-bootstrapper/dist/native-modules/aurelia-bootstrapper.js

Expected/desired behavior: I would expect the site to load and run fine.

ItWorksOnMyMachine commented 3 years ago

I found some example code in a closed issue and the webpack.config.js file included target: "web". I didn't have this set. After setting it, this issue is resolved.