Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] template-compiler is not usable with Embroider(staticAddonTrees: true) + ember 3.27 #19568

Closed
NullVoxPopuli opened this issue May 28, 2021 · 8 comments

Comments

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented May 28, 2021

🐞 Describe the Bug

The template compiler cannot be used with Ember 3.27 (modules! 🎉 ) and embroider:

🔬 Minimal Reproduction

https://github.com/NullVoxPopuli/repro-emberjs-16568

😕 Actual Behavior

This error occurs when calling compile:

Error: Cannot call `compile` with only the template compiler loaded. Please load `ember.debug.js` or `ember.prod.js` prior to calling `compile`.

🤔 Expected Behavior

compile succeeds as it does with Ember 3.26

🌍 Environment

  • Ember: - 3.27.2
  • Node.js/npm: - 4.17.0
  • OS: - Ubuntu 20.04
  • Browser: - FireFox Developer Edition 89.0b15 (64-bit)

➕ Additional Context

deployed repro here:

@ef4
Copy link
Contributor

ef4 commented May 28, 2021

All ember internal use of this pattern:

import require, { has } from 'require';

Needs to stop. We have replacements already (in @embroider/macros) that work in both non-embroider and embroider builds.

@NullVoxPopuli
Copy link
Contributor Author

@ef4 do you have an example Pr or anything of what it takes to swap out that require stuff with @embroider/macros? I could try PRing those changes to the template-compiler and other places in ember

@NullVoxPopuli
Copy link
Contributor Author

wip: #19569

@rwjblue
Copy link
Member

rwjblue commented Jun 3, 2021

All ember internal use of this pattern:

import require, { has } from 'require';

Needs to stop. We have replacements already (in @embroider/macros) that work in both non-embroider and embroider builds.

Obviously you are correct, but the compat adapter that Embroider ships could easily handle these cases.

@NullVoxPopuli
Copy link
Contributor Author

I've tried reproing here: https://github.com/NullVoxPopuli/repro-emberjs-16568/blob/main/app/routes/application.js#L25
but it's working, so I have more digging to do

NullVoxPopuli added a commit to NullVoxPopuli/repro-emberjs-16568 that referenced this issue Jun 8, 2021
@NullVoxPopuli
Copy link
Contributor Author

NullVoxPopuli commented Jun 8, 2021

ah! success! (I have minimal reproduction)
all I needed was to add this:

    staticAddonTrees: true,
    staticAddonTestSupportTrees: true,
    staticHelpers: true,
    staticComponents: true,
    splitControllers: true,
    splitRouteClasses: true,

to my embroider config: NullVoxPopuli/repro-emberjs-16568@89e8699

@NullVoxPopuli
Copy link
Contributor Author

in particular, staticAddonTrees: true causes this error

@NullVoxPopuli NullVoxPopuli changed the title [Bug] template-compiler is not usable with Embroider + ember 3.27 [Bug] template-compiler is not usable with Embroider(staticAddonTrees: true) + ember 3.27 Jun 8, 2021
@NullVoxPopuli
Copy link
Contributor Author

NullVoxPopuli commented Jul 10, 2021

This is no longer an issue with https://github.com/NullVoxPopuli/ember-repl/
(but probably other reasons, too 🤷 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants