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.

Can't resolve 'ember-cli-surge/blueprints/surge'

See original GitHub issue

After having linked the latest embroider packages and trying to build/run the app, I get the following error:

Module not found: Error: Can’t resolve ‘ember-cli-surge/blueprints/surge’ in ‘/private/var/folders/qb/zkbx5mt13qggl5zc8h19fy4h0000gn/T/embroider/48c6b9/blueprints’

This is thrown from this line:

export { default } from ‘ember-cli-surge/blueprints/surge’;

I’m not sure if this is the correct way to import the blueprint, since it’s actually under ember-cli-surge/blueprints/ember-cli-surge/index.js (see here), but the build is successful if built the “classic” way (without Embroider).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ef4commented, Jun 27, 2019

It’s true that we don’t support blueprints in v2 addons yet. But that shouldn’t be relevant, because ember generate and ember build are completely disconnected from each other. Embroider only affects the build. Blueprints run un-affected by Embroider.

This is a bug in ember-cli-surge. It is importing its blueprint code (which should only ever run in Node) into the app’s runtime (browser) code. Specifically, this file probably needs to get deleted.

Here is a workaround until upstream can be fixed:

return require('@embroider/compat').compatBuild(app, Webpack, {
    compatAdapters: new Map([[
      'ember-cli-surge',
      class extends (require('@embroider/compat').V1Addon) {
        get packageMeta() {
          let meta = super.packageMeta;
          delete meta['app-js'];
          return meta;
        }
      }
    ]])
  });
0reactions
balinterdicommented, Jun 27, 2019

To me this would imply that blueprints would just work without any extra action when switching to use Embroider. Do you interpret it differently?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't resolve 'fs' when bundle with webpack #447 - GitHub
to webpack config file and the error is gone. Not sure how it works, It seems like webpack did some thing with fs...
Read more >
Module not found: Error: Can't resolve 'fs' in dotenv/lib
To solve this: Create the .env file at the root level of you app; Name your variables beginning with REACT_APP_ // that's the...
Read more >
How to fix 'Module not found: Can't resolve 'http' in ... - YouTube
Basically, just change 'react-scripts' to 4.0.2 in your package.json and run `npm install` again :D Follow me on Twitter: ...
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