emberjs / ember.js

Ember.js - A JavaScript framework for creating ambitious web applications
https://emberjs.com
MIT License
22.46k stars 4.21k forks source link

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

Open NullVoxPopuli opened 4 months ago

NullVoxPopuli commented 4 months ago

🐞 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

➕ 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 commented 4 months ago

this is resolved if statkcEmberSource is turned off

boris-petrov commented 4 months ago

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

NullVoxPopuli commented 4 months ago

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

NullVoxPopuli commented 4 months ago

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".