ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

[Bug] 5.6: ember-template-compiler cannot used Application.initializer, as it could not be a function, and also: <...>.Test is undefined

Open NullVoxPopuli opened this issue 2 years ago • 4 comments

🐞 Describe the Bug

A clear and concise description of what the bug is.

image

😕 Actual Behavior

error

🤔 Expected Behavior

template-compiler loads at runitme.

(I know this'll be fixed by the new runtime compiler, but that isn't available yet, so folks needing to use runtime compilation must stay on, at newest, ember-source 5.5)

🌍 Environment

  • Ember: - 5.6

➕ Additional Context

Loaded via: ember-cli-build.js (with embroider / webpack)

  // Adds:
  //  - ember-template-compiler
  //  - @glimmer/syntax
  app.import('vendor/ember/ember-template-compiler.js');
    staticAddonTrees: true,
    staticAddonTestSupportTrees: true,
    staticHelpers: true,
    staticModifiers: true,
    staticComponents: true,
    staticEmberSource: true,
    staticAppPaths: ['utils'],

NullVoxPopuli avatar Feb 04 '24 18:02 NullVoxPopuli

this is resolved if statkcEmberSource is turned off

NullVoxPopuli avatar Feb 04 '24 18:02 NullVoxPopuli

So this is a problem only under Embroider? I didn't see such an issue in my case using ember-cli.

boris-petrov avatar Feb 12 '24 17:02 boris-petrov

yeah, older ember-cli ships everything in node_modules, and there is no staticEmberSource option :sweat_smile:

NullVoxPopuli avatar Feb 12 '24 20:02 NullVoxPopuli

Looks like this happens for tests, too:

Uncaught TypeError: ember__WEBPACK_IMPORTED_MODULE_6__.default.Test is undefined
    setupTestAdapter index.js:123
    start index.js:203
    js test-helper.js:13
    Webpack 7
[index.js:123:36](webpack://docs-app/src/index.js)
Uncaught Error: The tests file was not loaded. Make sure your tests index.html includes "assets/tests.js".

NullVoxPopuli avatar Feb 13 '24 03:02 NullVoxPopuli