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

Error in FastBoot: "Cannot read property 'require' of null" #1141

Closed
marcoow opened this issue Aug 25, 2020 · 6 comments · Fixed by #1155 or emberjs/ember.js#19125
Closed

Error in FastBoot: "Cannot read property 'require' of null" #1141

marcoow opened this issue Aug 25, 2020 · 6 comments · Fixed by #1155 or emberjs/ember.js#19125
Labels

Comments

@marcoow
Copy link
Member

marcoow commented Aug 25, 2020

We're currently seeing an error in the FastBoot tests in ember-simple-auth that originates in @glimmer/runtime:

/var/folders/cx/h0pn1kjn4971gtp4_5mrm3940000gn/T/broccoli-70503kLAdbxQD1YdI/out-423-broccoli_merge_trees/assets/vendor.js:58488
    var nodeURL = _nodeModule.module.require('url');
                                     ^

TypeError: Cannot read property 'require' of null
    at /var/folders/cx/h0pn1kjn4971gtp4_5mrm3940000gn/T/broccoli-70503kLAdbxQD1YdI/out-423-broccoli_merge_trees/assets/@glimmer/runtime.js:288:1
    at internalRequire (/var/folders/cx/h0pn1kjn4971gtp4_5mrm3940000gn/T/broccoli-70503kLAdbxQD1YdI/out-423-broccoli_merge_trees/assets/loader.js:54:1)
    at internalRequire (/var/folders/cx/h0pn1kjn4971gtp4_5mrm3940000gn/T/broccoli-70503kLAdbxQD1YdI/out-423-broccoli_merge_trees/assets/loader.js:50:1)
    at internalRequire (/var/folders/cx/h0pn1kjn4971gtp4_5mrm3940000gn/T/broccoli-70503kLAdbxQD1YdI/out-423-broccoli_merge_trees/assets/loader.js:50:1)
    at internalRequire (/var/folders/cx/h0pn1kjn4971gtp4_5mrm3940000gn/T/broccoli-70503kLAdbxQD1YdI/out-423-broccoli_merge_trees/assets/loader.js:50:1)
    at require (/var/folders/cx/h0pn1kjn4971gtp4_5mrm3940000gn/T/broccoli-70503kLAdbxQD1YdI/out-423-broccoli_merge_trees/assets/loader.js:87:1)
    at /var/folders/cx/h0pn1kjn4971gtp4_5mrm3940000gn/T/broccoli-70503kLAdbxQD1YdI/out-423-broccoli_merge_trees/assets/vendor.js:76572:1
    at /var/folders/cx/h0pn1kjn4971gtp4_5mrm3940000gn/T/broccoli-70503kLAdbxQD1YdI/out-423-broccoli_merge_trees/assets/vendor.js:76573:2
    at Script.runInContext (vm.js:127:20)
    at VMSandbox.eval (/Users/marcoow/Code/ember-simple-auth/node_modules/fastboot/src/vm-sandbox.js:14:16)
    at /Users/marcoow/Code/ember-simple-auth/node_modules/fastboot/src/ember-app.js:190:15
    at Array.forEach (<anonymous>)
    at EmberApp.loadAppFiles (/Users/marcoow/Code/ember-simple-auth/node_modules/fastboot/src/ember-app.js:187:21)
    at EmberApp.retrieveSandboxedApp (/Users/marcoow/Code/ember-simple-auth/node_modules/fastboot/src/ember-app.js:235:10)
    at new EmberApp (/Users/marcoow/Code/ember-simple-auth/node_modules/fastboot/src/ember-app.js:61:21)
    at FastBoot._buildEmberApp (/Users/marcoow/Code/ember-simple-auth/node_modules/fastboot/src/index.js:114:17)
    at new FastBoot (/Users/marcoow/Code/ember-simple-auth/node_modules/fastboot/src/index.js:52:10)
    at /Users/marcoow/Code/ember-simple-auth/node_modules/ember-cli-fastboot/index.js:335:29
    at Layer.handle [as handle_request] (/Users/marcoow/Code/ember-simple-auth/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/marcoow/Code/ember-simple-auth/node_modules/express/lib/router/index.js:317:13)
    at /Users/marcoow/Code/ember-simple-auth/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/Users/marcoow/Code/ember-simple-auth/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/marcoow/Code/ember-simple-auth/node_modules/express/lib/router/index.js:275:10)
    at /Users/marcoow/Code/ember-simple-auth/node_modules/ember-cli/lib/tasks/server/middleware/broccoli-watcher/index.js:54:11
    at watcher.then.errorHandler.buildError (/Users/marcoow/Code/ember-simple-auth/node_modules/broccoli-middleware/lib/watcher-middleware.js:35:7)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

I suspect this has to do with the recent refactoring (#1138) since specifically this line is failing:

47142cc#diff-33ba693279a12bb3f292beae96c25b03R43

The error can be reproduced by running the ember-simple-auth test app for the latest ember-beta (which I suppose contains the above change):

yarn workspace test-app test:one ember-beta --- ember s
@raido
Copy link

raido commented Aug 26, 2020

I have hit same thing over here: ember-cli/ember-page-title#168

beta and canary builds fail with this error.

@rwjblue
Copy link
Member

rwjblue commented Aug 26, 2020

Thank you for reporting @marcoow!

@rwjblue rwjblue added the bug label Aug 26, 2020
simonihmig added a commit to ember-bootstrap/ember-bootstrap that referenced this issue Aug 30, 2020
It was intended before to run FastBoot tests only within the explicit ember-try scenario, but actually they did run for every scenario. This should fix it.

However we may revise that later, as FastBoot tests using `ember-cli-fastboot-testing` don't suffer from the overhead they had before. But we should do that eventually only after glimmerjs/glimmer-vm#1141 is fixed, which currently causes FastBoot tests to fail for Ember beta/canary.
simonihmig added a commit to ember-bootstrap/ember-bootstrap that referenced this issue Aug 30, 2020
It was intended before to run FastBoot tests only within the explicit ember-try scenario, but actually they did run for every scenario. This should fix it.

However we may revise that later, as FastBoot tests using `ember-cli-fastboot-testing` don't suffer from the overhead they had before. But we should do that eventually only after glimmerjs/glimmer-vm#1141 is fixed, which currently causes FastBoot tests to fail for Ember beta/canary.
@kiwiupover
Copy link
Contributor

@rwjblue how are things going?

@rwjblue
Copy link
Member

rwjblue commented Sep 2, 2020

I've finally reproduced the error over in emberjs/ember.js#19123. Working on a fix here in glimmer-vm now...

@kiwiupover
Copy link
Contributor

@rwjblue good on ya mate!

@rwjblue
Copy link
Member

rwjblue commented Sep 2, 2020

Fixed by #1155, working on backporting and landing in affected Ember versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants