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

Full compat() builds fine, but fails to run because not resolvind modules #884

Closed
delaneyj opened this issue Jun 30, 2021 · 16 comments
Closed

Comments

@delaneyj
Copy link

Able to build/dev with the full compat version

		return require("@embroider/compat").compatBuild(app, Webpack, {
		// staticAddonTestSupportTrees: true,
		// staticAddonTrees: true,
		// staticHelpers: true,
		// staticComponents: true,
		// splitAtRoutes: ['route.name'], // can also be a RegExp
		packagerOptions: {
			webpackConfig: {
				externals: [
					nodeWebExternals(),
				],
			},
		},
	});
}

However at runtime

loader.js:247 Uncaught Error: Could not find module `uuid` imported from `(require)`
    at missingModule (loader.js:247)
    at findModule (loader.js:258)
    at requireModule (loader.js:24)
    at Object.uuid (chunk.6edae10b2c141b5c5de6.js:18019)
    at __webpack_require__ (chunk.6edae10b2c141b5c5de6.js:18043)
    at eval (app.js:5)
    at Object../app.js (chunk.6edae10b2c141b5c5de6.js:1075)
    at __webpack_require__ (chunk.6edae10b2c141b5c5de6.js:18043)
    at eval (px-web-client.js:8027)
    at Object../assets/px-web-client.js (chunk.6edae10b2c141b5c5de6.js:1118)

The failing code is

import {v4} from  'uuid'
console.log(v4())

Note the uuid library exists both in package.json and the node_modules directory. There isn't much information on how to tackle this. Tried also changing to const uuid = require('uuid') but seeing the same missing module error. Is there any guidance I'm missing? Thanks!

@ef4
Copy link
Contributor

ef4 commented Jul 5, 2021

Where does your code do the import from uuid? Within the app? Tests? An addon? Is that file JS or TS?

@delaneyj
Copy link
Author

delaneyj commented Jul 7, 2021

Its all JS, it within the app. I had this working with ember-auto-import and webpack but the build times are 2x slower and takes 8gb heap space to even run compared to embroider. But no idea what to do with these runtime errors.

import {v4} from 'uuid'. And uuid is in node modules. What could I be missing?

@ef4
Copy link
Contributor

ef4 commented Jul 7, 2021

I had this working with ember-auto-import and webpack but the build times are 2x slower and takes 8gb heap space to even run

Hmm, that also sounds bad, can you please run a build like that with DEBUG=ember-auto-import:* and share the log in a new issue on ember-auto-import?

@ef4
Copy link
Contributor

ef4 commented Jul 7, 2021

To debug this, if you can log or break here:

function isResolvable(packageName: string, fromPkg: Package): false | Package {

when packageName === 'uuid', that may help. We would expect that function to return true, but it looks like it may be returning false.

@delaneyj
Copy link
Author

delaneyj commented Jul 8, 2021

Where does your code do the import from uuid? Within the app? Tests? An addon? Is that file JS or TS?

I added at the very top of app.js just to verify its not an issue with nested imports.

import * as uuid from  'uuid'
console.log(uuid)

import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

const App = Application.extend({
	modulePrefix: config.modulePrefix,
	podModulePrefix: config.podModulePrefix,
	Resolver
});



// Generate our own polyfill…
if (![].flat) {
	Object.defineProperty(Array.prototype, 'flat', {
		value: function() {
			return [].concat.apply([], this);
		}
	});
}

if (!String.prototype.replaceAll) {
	String.prototype.replaceAll = function(str, newStr) {
		return this.split(str).join(newStr);
	};
}

loadInitializers(App, config.modulePrefix);

export default App;

@delaneyj
Copy link
Author

delaneyj commented Jul 8, 2021

To debug this, if you can log or break here:

function isResolvable(packageName: string, fromPkg: Package): false | Package {

when packageName === 'uuid', that may help. We would expect that function to return true, but it looks like it may be returning false.

Interestingly it appears 'uuid' doesn't show up at all....

Adding console.log(XXX ${packageName} ${JSON.stringify(fromPkg)}) to start of isResolvable

broccoli-babel-transpiler is opting out of caching due to a plugin that does not provide a caching strategy: `class InElementTransform {
  transform(ast) {
    let b = this.syntax.builders;

    this.syntax.traverse(ast, {
      BlockStatement(node) {
        if (node.path.original === 'in-element') {
          node.path.original = '-in-element';
          node.path.parts = ['-in-element'];

          let insertBeforeHash = node.hash.pairs.find(pair => pair.key === "insertBefore");

          // Somehow `insertBefore=undefined` gets effectively passed when invoking `{{#in-element dest}}` in Ember 3.17+
          // which later throws in Ember's own AST transform, so removing this here.
          if (insertBeforeHash && insertBeforeHash.value.type === 'UndefinedLiteral') {
            node.hash.pairs = node.hash.pairs.filter(hash => hash !== insertBeforeHash);
            insertBeforeHash = null;
          }

          if (insertBeforeHash) {
            if (insertBeforeHash.value.type !== "NullLiteral") {
              throw new SyntaxError('insertBefore only takes `null` as an argument');
            }

            node.hash.pairs = node.hash.pairs.filter(hash => hash !== insertBeforeHash);
          } else {
            let [targetNode] = node.params;

            node.params[0] = b.sexpr(
              '-clear-element',
              [targetNode]
            );
          }
        }
      }
    });

    return ast;
  }
}`.
broccoli-babel-transpiler is opting out of caching due to a plugin that does not provide a caching strategy: `class InElementTransform {
  transform(ast) {
    let b = this.syntax.builders;

    this.syntax.traverse(ast, {
      BlockStatement(node) {
        if (node.path.original === 'in-element') {
          node.path.original = '-in-element';
          node.path.parts = ['-in-element'];

          let insertBeforeHash = node.hash.pairs.find(pair => pair.key === "insertBefore");

          // Somehow `insertBefore=undefined` gets effectively passed when invoking `{{#in-element dest}}` in Ember 3.17+
          // which later throws in Ember's own AST transform, so removing this here.
          if (insertBeforeHash && insertBeforeHash.value.type === 'UndefinedLiteral') {
            node.hash.pairs = node.hash.pairs.filter(hash => hash !== insertBeforeHash);
            insertBeforeHash = null;
          }

          if (insertBeforeHash) {
            if (insertBeforeHash.value.type !== "NullLiteral") {
              throw new SyntaxError('insertBefore only takes `null` as an argument');
            }

            node.hash.pairs = node.hash.pairs.filter(hash => hash !== insertBeforeHash);
          } else {
            let [targetNode] = node.params;

            node.params[0] = b.sexpr(
              '-clear-element',
              [targetNode]
            );
          }
        }
      }
    });

    return ast;
  }
}`.
broccoli-babel-transpiler is opting out of caching due to a plugin that does not provide a caching strategy: `function StripTestSelectorsTransform() {
  this.syntax = null;
}`.
broccoli-babel-transpiler is opting out of caching due to a plugin that does not provide a caching strategy: `function StripTestSelectorsTransform() {
  this.syntax = null;
}`.
Building into /tmp/embroider/1fc283
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-cli-nouislider","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-scrollable","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-element-resize-detector","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-scrollable","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-scrollable","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-light-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-light-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-light-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-light-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-light-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-light-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-light-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-light-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-light-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-light-table/node_modules/ember-wormhole","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-light-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-light-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/liquid-fire","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/liquid-fire","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-wormhole","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/liquid-fire","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/liquid-fire","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/liquid-fire","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/liquid-fire","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/liquid-fire","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/liquid-fire","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/liquid-fire","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/liquid-fire","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/liquid-fire","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-pikaday","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/@html-next/vertical-collection","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-popper","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-popper","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283/node_modules/ember-table","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","peerDependencies"]}
XXX @ember/template-factory {"root":"/tmp/embroider/1fc283","packageCache":{"rootCache":{},"resolutionCache":{}},"dependencyKeys":["dependencies","devDependencies","peerDependencies"]}
2021-07-08T16:30:30.803Z pxwebclient buildTime="2021-07-08T16:30:02.732Z"

Build successful (24578ms) – Serving on http://localhost:4200/

Slowest Nodes (totalTime >= 5%) | Total (avg)
-------------------------------------------------------------------------------------------------------+--------------------------
@embroider/webpack (1) | 17503ms
@embroider/compat/app (1) | 1650ms

@ef4
Copy link
Contributor

ef4 commented Jul 8, 2021

Ah, you are hitting the cache. Try again after rm -rf $TMPDIR/embroider.

@delaneyj
Copy link
Author

@ef4 sorry I was delayed. Clearing the cache the build -w has the following warnings

WARNING in ./node_modules/@ember-data/adapter/-private.js 4:38-45
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./assets/px-web-client.js 5209:9-64

WARNING in ./node_modules/@ember-data/adapter/-private.js 4:48-55
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./assets/px-web-client.js 5209:9-64

WARNING in ./node_modules/@ember-data/adapter/-private.js 4:69-76
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./assets/px-web-client.js 5209:9-64

WARNING in ./node_modules/@ember-data/adapter/-private.js 185:8-15
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./assets/px-web-client.js 5209:9-64

WARNING in ./node_modules/@ember-data/store/index.js 4:0-198
export 'Store' (reexported as 'default') was not found in './-private' (module has no exports)
 @ ./assets/px-web-client.js 5206:9-59

WARNING in ./node_modules/@ember-data/store/index.js 4:0-198
export 'normalizeModelName' (reexported as 'normalizeModelName') was not found in './-private' (module has no exports)
 @ ./assets/px-web-client.js 5206:9-59

WARNING in ./node_modules/@ember-data/store/index.js 4:0-198
export 'setIdentifierGenerationMethod' (reexported as 'setIdentifierGenerationMethod') was not found in './-private' (module has no exports)
 @ ./assets/px-web-client.js 5206:9-59

WARNING in ./node_modules/@ember-data/store/index.js 4:0-198
export 'setIdentifierUpdateMethod' (reexported as 'setIdentifierUpdateMethod') was not found in './-private' (module has no exports)
 @ ./assets/px-web-client.js 5206:9-59

WARNING in ./node_modules/@ember-data/store/index.js 4:0-198
export 'setIdentifierForgetMethod' (reexported as 'setIdentifierForgetMethod') was not found in './-private' (module has no exports)
 @ ./assets/px-web-client.js 5206:9-59

WARNING in ./node_modules/@ember-data/store/index.js 4:0-198
export 'setIdentifierResetMethod' (reexported as 'setIdentifierResetMethod') was not found in './-private' (module has no exports)
 @ ./assets/px-web-client.js 5206:9-59

WARNING in ./node_modules/@ember-data/store/index.js 4:0-198
export 'recordIdentifierFor' (reexported as 'recordIdentifierFor') was not found in './-private' (module has no exports)
 @ ./assets/px-web-client.js 5206:9-59

4 warnings have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.47.0 compiled with 11 warnings in 31981 ms
2021-07-27T22:07:21.376Z pxwebclient buildTime="2021-07-27T22:06:28.241Z"

but does at least run, however the same issue

Uncaught Error: Could not find module `uuid` imported from `(require)`
    at missingModule (vendor.js:17298)
    at findModule (vendor.js:17309)
    at requireModule (vendor.js:17075)
    at Object.uuid (chunk.ffc67e11caddf75c954a.js:18766)
    at __webpack_require__ (chunk.ffc67e11caddf75c954a.js:18790)
    at eval (webpack://px-web-client/./app.js?:5)
    at Object../app.js (chunk.ffc67e11caddf75c954a.js:767)
    at __webpack_require__ (chunk.ffc67e11caddf75c954a.js:18790)
   ...

With "uuid": "8.3.2", being in the dependencies of package.json

@basz
Copy link

basz commented Jun 25, 2022

i seem to have this issue too. did you happen to find a resolve for it?

@NullVoxPopuli
Copy link
Collaborator

@basz can you provide details?

@basz
Copy link

basz commented Jun 25, 2022

not much

it's a mono repo app with ember 3.28.8 with in repo addons. Currently i'm stuck here. App compiles, but on runtime the import of uuid does not work. The reference uuid import is in one of the addons.

I have tried to place uuid inside the addon package (both devDependecies an dependencies) which does not help.
it seemed it was not neccesary to do that pre-embroider.

@NullVoxPopuli
Copy link
Collaborator

it seemed it was not neccesary to do that pre-embroider.

pre-embroider is a hot-mess of "accidentally working".

Can you create an open source reproduction?

@basz
Copy link

basz commented Jun 25, 2022

Ah. I'll try to do that

@basz
Copy link

basz commented Jun 27, 2022

I'm note sure what I did differently but I now have uuid loading in my addon¿ I just added uuid as a dependency and now it work... monday vs saterday i guess...

@vlascik
Copy link
Contributor

vlascik commented Jul 22, 2022

Seems that this is related to #1116 . I have created a reproduction of the same (or similar) problem at https://github.com/vlascik/repro-embroider-missing-modules . Description of what I did there is in #1116 (comment)

@NullVoxPopuli
Copy link
Collaborator

It seems like this could be another case of "anything you import from needs to be declared in package.json"?

If not, I can re-open!

otherwise, if anyone is having similar issues, we may be more productive opening a separate issue, as I'm going to close this one for now. <3

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

No branches or pull requests

5 participants