embroider-build / embroider

Compiling Ember apps into spec-compliant, modern Javascript.
MIT License
329 stars 137 forks source link

`{{unique-id}}` helper is broken in 3.4.8 #1889

Open jknight12882 opened 1 week ago

jknight12882 commented 1 week ago

Looks related to the changes made in @embroider/compat@3.4.7. Throws the following error when rendering a template with the {{unique-id}} helper

manager.js:394 Uncaught (in promise) Error: Attempted to use a value as a helper, but it was not an object or function. Helper definitions must be objects or functions with an associated helper manager. The value was: undefined
    at getInternalHelperManager (manager.js:394:1)
    at ConstantsImpl.helper (program.js:95:1)
    at resolveHelper (opcode-compiler.js:207:1)
    at encodeOp (opcode-compiler.js:1976:1)
    at pushOp (opcode-compiler.js:1911:1)
    at opcode-compiler.js:420:1
    at Compilers.compile (opcode-compiler.js:405:1)
    at expr (opcode-compiler.js:553:1)
    at CompilePositional (opcode-compiler.js:622:1)
    at opcode-compiler.js:1833:1
    at Compilers.compile (opcode-compiler.js:405:1)
    at compileStatements (opcode-compiler.js:1914:1)
    at maybeCompile (opcode-compiler.js:1896:1)
    at CompilableTemplateImpl.compile (opcode-compiler.js:1879:1)
    at VM.compile (runtime.js:4678:1)
    at Object.evaluate (runtime.js:1930:1)
    at AppendOpcodes.evaluate (runtime.js:1033:1)
    at LowLevelVM.evaluateSyscall (runtime.js:4109:1)
    at LowLevelVM.evaluateInner (runtime.js:4080:1)
    at LowLevelVM.evaluateOuter (runtime.js:4073:1)
    at VM.next (runtime.js:4871:1)
    at VM._execute (runtime.js:4858:1)
    at VM.execute (runtime.js:4833:1)
    at runtime.js:4916:1
    at runInTrackingTransaction (validator.js:133:1)
    at TemplateIteratorImpl.sync (runtime.js:4916:1)
    at index.js:4684:1
    at RootState.render (index.js:4653:1)
    at index.js:4943:1
    at inTransaction (runtime.js:3985:1)
    at Renderer._renderRoots (index.js:4925:1)
    at Renderer._renderRootsTransaction (index.js:4969:1)
    at Renderer._renderRoot (index.js:4914:1)
    at Renderer._appendDefinition (index.js:4839:1)
    at Renderer.appendOutletView (index.js:4829:1)
    at invoke (backburner.js:272:1)
    at Queue.flush (backburner.js:188:1)
    at DeferredActionQueues.flush (backburner.js:342:1)
    at Backburner._end (backburner.js:770:1)
    at Backburner._boundAutorunEnd (backburner.js:507:1)
void-mAlex commented 1 week ago

hello @jknight12882 what version of ember source are you on?

jknight12882 commented 1 week ago

4.12.4

void-mAlex commented 1 week ago

thank you, that version should already have the built in unique-id helper is it a public app by any chance?

do you have the polyfill instealled? which options are you using for embroider (specifically asking about staticModifiers and staticHelpers) but all are informative

are you using gjs/gts files? what is being rendered route template/components?

jknight12882 commented 1 week ago

Unfortunately not a public app. Works fine with @embroider/compat@3.4.6. Not using gjs/gts. Using the following config


return require('@embroider/compat').compatBuild(app, Webpack, {
    staticAddonTestSupportTrees: true,
    staticAddonTrees: true,
    staticHelpers: true,
    staticModifiers: true,
    staticComponents: true,
    packagerOptions: {
      publicAssetURL: '<redacted>',

      webpackConfig: {
        devtool: 'source-map',
      },
    },
  });
jknight12882 commented 1 week ago

Also, not using the polyfill, using the ember-provided helper

jknight12882 commented 1 week ago

Also, we are using colocated components with the .js and .hbs file in the same /components folder