DEV Community

NullVoxPopuli
NullVoxPopuli

Posted on

4

unsupported ambiguity between helper and component

This error occurs when you're progressing towards a modern ember app and have the following situation in your embroider options:

staticHelpers: true,
staticComponents: false,
Enter fullscreen mode Exit fullscreen mode

and you reference a helper, such as {{t}} from ember-intl.

Here is the full text:

<path to source of issue>: 
  unsupported ambiguity between helper and component: 
    this use of "{{t}}" could be helper "{{ (t) }}" or
    component "<T />", and your settings for 
    staticHelpers and staticComponents do not agree. 
  Either switch to one of the unambiguous forms, 
    or make staticHelpers and staticComponents agree, 
    or use a "disambiguate" packageRule to work around 
    the problem if its in third-party code you cannot 
    easily fix. 
  in <path to source of issue>
Enter fullscreen mode Exit fullscreen mode

To resolve, in your ember-cli-build.js, you want:

 const { Webpack } = require('@embroider/webpack');

  return require('@embroider/compat').compatBuild(app, Webpack, {
    // ...
    staticHelpers: true,
    staticComponents: true,
    // ...
  });
Enter fullscreen mode Exit fullscreen mode

When both of these options are true, there is no more ambiguity with curly syntax ({{ }}) -- if it exists, it will be either a helper or a component, we don't need to guess at runtime anymore.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay