Skip to content
This repository was archived by the owner on Sep 9, 2021. It is now read-only.
This repository was archived by the owner on Sep 9, 2021. It is now read-only.

Uncaught TypeError: __WEBPACK_IMPORTED_MODULE_1___default.a is not a constructor #309

Description

@adambyer
  • Operating System: macOS Catalina 10.15.7
  • Node Version: v10.13.0
  • NPM Version: 6.14.9
  • webpack Version: 4.46.0
  • worker-loader Version: 3.0.8

Expected Behavior

Should get no errors and publicPath should work.

Actual Behavior

If I use webpack I get the following error when instantiating WORKER below... Uncaught TypeError: _dist_workers_worker_js__WEBPACK_IMPORTED_MODULE_1___default.a is not a constructor

If I import with worker-loader inline like import Worker from 'worker-loader!../../../dist/workers/worker.js' I don't get that error, but it doesn't seem that my publicPath in webpack is being applied because I get this error... `Security Error: Content at https://my-app.com may not load data from https://my-cdn.com/base/js/worker.bundle.worker.js.

Code

// webpack.config.js
{
    test: /\.worker\.js$/,
    use: {
        loader: 'worker-loader',
        options: {publicPath: '/workers/'},
    },
},
import Worker from '../../../dist/workers/worker.js'
const WORKER = new Worker()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions