Skip to content

Defining importScriptsTransform causes DataCloneError #105

@emattias

Description

@emattias

After updating ember to 3.21.3 we start getting a DataCloneError when the importScriptsTransform function is defined in ember-cli-build

JSReloader watches js|ts|hbs
⠙ building... [Babel: ember-cli-workbox > applyPatches]error: --------------------------------------------------------------------------
error: An uncaught YUIDoc error has occurred, stack trace given below
error: --------------------------------------------------------------------------
error: DataCloneError: (importScripts) => {
      return importScripts.map((importScript) => {
        return ENV.EMBER_ASSETS_ROOT_PA...<omitted>... } could not be cloned.
    at Worker.postMessage (internal/worker.js:279:23)
    at Worker.worker.send (/Users/emattias/repos/ember-cli-workbox/node_modules/broccoli-babel-transpiler/node_modules/workerpool/lib/WorkerHandler.js:77:10)
    at Array.forEach (<anonymous>)
    at dispatchQueuedRequests (/Users/emattias/repos/ember-cli-workbox/node_modules/broccoli-babel-transpiler/node_modules/workerpool/lib/WorkerHandler.js:240:21)
    at Worker.<anonymous> (/Users/emattias/repos/ember-cli-workbox/node_modules/broccoli-babel-transpiler/node_modules/workerpool/lib/WorkerHandler.js:195:7)
    at Worker.emit (events.js:315:20)
    at Worker.EventEmitter.emit (domain.js:482:12)
    at MessagePort.<anonymous> (internal/worker.js:192:55)
    at MessagePort.emit (events.js:315:20)
    at MessagePort.EventEmitter.emit (domain.js:482:12)
error: --------------------------------------------------------------------------

If you cant have functions in the app config is there some other way to send the function to the addon? Here's a workaround used by trackJs for a similar problem.

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