question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docs: add info about merged app directory

See original GitHub issue

We currently document one gotcha for addon authors building addons in TypeScript:

Because addons have no control over how files in app/ are transpiled, you cannot have .ts files in your addon’s app/ folder.

To expand on that for future readers who may stumble on this (and as a starting point for the docs we should write up):

Having .js supplied to a specific path inside the app namespace by both an addon and the app itself, when one of them is using TypeScript to generate that file, creates a caching problem. When addons inject .js files into the app namespace, and we’re compiling .ts files to .js files in the consuming app (always in the app namespace), or vice versa, we can end up in a situation where Ember CLI sees that there is already a .js file there, so it ignores the one generated from .ts. Which one it picks up seems to be semi-random (at least: we haven’t chased it down to see if it’s consistently replicable).

The real solution here is for addons to stop injecting themselves into the app namespace and to supply imports people can use instead to explicitly opt into using their functionality. However, until that becomes a community norm (best guess: not until Embroider lands), we should document this as a gotcha, including the kinds of build errors it produces, so that people find it when it happens to them and we have a useful place to direct addon authors to in understanding why and how they’re breaking their consumers.

Ecosystem issues

  • #724
  • ember-cli/ember-ajax#428
  • stefanpenner/broccoli-persistent-filter#166

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:18 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
patrickberkeleycommented, Jan 6, 2020

This is a big trap. Any app that consumes an addon that exports a file that matches the name of a file in the app will sporadically get a bad build.

ESA is one of the most popular add-ons, and it happens to export the application route. So that is why people have come across this issue using it.

Another very common case will be apps that consume app-specific addons (ones written just for one or two apps, not public consumption). The reason is this type of addon is often used to define a base which the one or more apps can extend. It is natural in this case for the files to have the same name in app and addon, and for there to be lots of them.

We were bitten by both the above scenarios (three apps use esa and consume two local add-ons). It was difficult to track down and cost us a bunch of time.

5reactions
lifeartcommented, Jul 31, 2019

// cc

I think it should be redlined and pinned in the docs - because this is floating behaviour and can create serious damage for business.

for case - we have application.ts route and have ember-simple-auth installed - it’s so easy to get issue with inconsistent builds, because there is no user action needed for it. (and alot of ember users use ember-simple-auth)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Merge text into a document | Google Docs
Merge text into a document ... One useful application of the Google Docs API is to merge information from one or more data...
Read more >
Merge Google Spreadsheet Data with Google Documents
Create a folder in your Google Drive to store your spreadsheet, document template, and merged documents · New > Folder > Enter folder...
Read more >
Mail Merge Using Google Docs - YouTube
Discover how to easily run a mail merge using Google Docs. To do a mail merge using Google Drive, you need to use...
Read more >
Mail merge for Google Docs
Easiest mail merge add-on to generate documents or letters, send emails and print envelopes. Export to PDF, Word or print right in Google ......
Read more >
How to Do Mail Merge Using Google Docs (Step-by-Step Guide)
These Google Workspace (formerly G Suite) apps let you create personalized Google Doc files by automatically inserting data from a Google ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found