Skip to content

_compilation property deprecated and undefined in latest webpack ? #42

@AlexandreBonaventure

Description

@AlexandreBonaventure

Hi,
with webpack@4.14.0, I'm unable to get this loader working. It throws an error at build time!
I can see _compilation in the deprecated properties in the loader API https://webpack.js.org/api/loaders/#deprecated-context-properties
Maybe it has been removed completely in the latest webpack versions ??

Cannot read property 'createChildCompiler' of undefined
    at Object.loader.pitch (/node_modules/workerize-loader/dist/index.js:28:41)

Here's what gives when I console.log(this._compilation)

{ version: 2,
  resolve: [Function: resolve],
  emitWarning: [Function: emitWarning],
  emitError: [Function: emitError],
  exec: [Function: exec],
  options:
   { context: '' },
  webpack: true,
  'thread-loader': true,
  sourceMap: true,
  context: '/src/core/shared/timer',
  loaderIndex: 1,
  loaders:
   [ { path: '/node_modules/babel-loader/lib/index.js',
       query: '',
       options: undefined,
       ident: undefined,
       normal: [Function],
       pitch: undefined,
       raw: undefined,
       data: null,
       pitchExecuted: true,
       normalExecuted: false,
       request: [Getter/Setter] },
     { path: '/node_modules/worker-loader/dist/cjs.js',
       query: '',
       options: undefined,
       ident: undefined,
       normal: [Function],
       pitch: [Function: pitch],
       raw: undefined,
       data: {},
       pitchExecuted: true,
       normalExecuted: false,
       request: [Getter/Setter] },
     { path: '/node_modules/eslint-loader/index.js',
       query: '??ref--13-0',
       options: [Object],
       ident: 'ref--13-0',
       normal: null,
       pitch: null,
       raw: null,
       data: null,
       pitchExecuted: false,
       normalExecuted: false,
       request: [Getter/Setter] } ],
  resourcePath: '/src/core/shared/timer/refresh.worker.js',
  resourceQuery: '',
  async: [Function: async],
  callback: [Function],
  cacheable: [Function: cacheable],
  addDependency: [Function: addDependency],
  dependency: [Function: addDependency],
  addContextDependency: [Function: addContextDependency],
  getDependencies: [Function: getDependencies],
  getContextDependencies: [Function: getContextDependencies],
  clearDependencies: [Function: clearDependencies],
  resource: [Getter/Setter],
  request: [Getter],
  remainingRequest: [Getter],
  currentRequest: [Getter],
  previousRequest: [Getter],
  query: [Getter],
  data: [Getter] }
{ version: 2,
  resolve: [Function: resolve],
  emitWarning: [Function: emitWarning],
  emitError: [Function: emitError],
  exec: [Function: exec],
  options:
   { context: '' },
  webpack: true,
  'thread-loader': true,
  sourceMap: true,
  context: '/src/location',
  loaderIndex: 1,
  loaders:
   [ { path: '/node_modules/babel-loader/lib/index.js',
       query: '',
       options: undefined,
       ident: undefined,
       normal: [Function],
       pitch: undefined,
       raw: undefined,
       data: null,
       pitchExecuted: true,
       normalExecuted: false,
       request: [Getter/Setter] },
     { path: '/node_modules/worker-loader/dist/cjs.js',
       query: '',
       options: undefined,
       ident: undefined,
       normal: [Function],
       pitch: [Function: pitch],
       raw: undefined,
       data: {},
       pitchExecuted: true,
       normalExecuted: false,
       request: [Getter/Setter] },
     { path: '/node_modules/eslint-loader/index.js',
       query: '??ref--13-0',
       options: [Object],
       ident: 'ref--13-0',
       normal: null,
       pitch: null,
       raw: null,
       data: null,
       pitchExecuted: false,
       normalExecuted: false,
       request: [Getter/Setter] } ],
  resourcePath: '/src/location/conflict-detector.worker.js',
  resourceQuery: '',
  async: [Function: async],
  callback: [Function],
  cacheable: [Function: cacheable],
  addDependency: [Function: addDependency],
  dependency: [Function: addDependency],
  addContextDependency: [Function: addContextDependency],
  getDependencies: [Function: getDependencies],
  getContextDependencies: [Function: getContextDependencies],
  clearDependencies: [Function: clearDependencies],
  resource: [Getter/Setter],
  request: [Getter],
  remainingRequest: [Getter],
  currentRequest: [Getter],
  previousRequest: [Getter],
  query: [Getter],
  data: [Getter] }

Hope to hear from you guys!
Thanks for this awesome package!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions