Closed chrism closed 4 years ago
Hmm, does that error still occur if you remove fastboot?
I’m guessing that the issue is that this resolver config needs the config
type added. Maybe you could confirm and send in a PR over there?
Sorry for my slow reply.
Hmm, does that error still occur if you remove fastboot?
No, it was working fine.
I’m guessing that the issue is that this resolver config needs the config type added. Maybe you could confirm and send in a PR over there?
So... I have tried to do this.
I forked the ember-resolver
repo and adding it to package.json
in the form
"ember-resolver": "file:./../ember-resolver"
Running yarn
seemed to update the package and after adding the type (I started with this as I don't really have an understanding of how this works).
config: {},
There was a different error regarding the need for a definitiveCollection
instead of not a recognized type
.
This is when I ran into problems :(
It didn't seem like my app was picking up the changes I'd made to the local ember-resolver
package.
In my attempt to pull in the latest version (this is all new to me) I ran
yarn upgrade ember-resolver
This changed quite a few dependencies and after that any attempt to run
EMBER_CLI_MODULE_UNIFICATION=true ember serve
Now resulted in an error message.
Cannot read property 'replace' of undefined
Checking the error log showed this
ERROR Summary:
- broccoliBuilderErrorStack: [undefined]
- codeFrame: [undefined]
- errorMessage: Cannot read property 'replace' of undefined
- errorType: [undefined]
- location:
- column: [undefined]
- file: [undefined]
- line: [undefined]
- message: Cannot read property 'replace' of undefined
- name: TypeError
- nodeAnnotation: [undefined]
- nodeName: [undefined]
- originalErrorMessage: [undefined]
- stack: TypeError: Cannot read property 'replace' of undefined
at Class.serverMiddleware (/Users/username/git/test-fastboot-mu/node_modules/ember-cli-inject-live-reload/index.js:44:38)
at ExpressServerTask.<anonymous> (/Users/username/git/test-fastboot-mu/node_modules/ember-cli/lib/tasks/server/express-server.js:101:22)
at /Users/username/git/test-fastboot-mu/node_modules/promise-map-series/index.js:11:14
at tryCatch (/Users/username/git/test-fastboot-mu/node_modules/rsvp/dist/rsvp.js:525:12)
at invokeCallback (/Users/username/git/test-fastboot-mu/node_modules/rsvp/dist/rsvp.js:538:13)
at publish (/Users/username/git/test-fastboot-mu/node_modules/rsvp/dist/rsvp.js:508:7)
at flush (/Users/username/git/test-fastboot-mu/node_modules/rsvp/dist/rsvp.js:2415:5)
at process._tickCallback (internal/process/next_tick.js:112:11)
What is really strange is that out of desperation I deleted the entire directory and cloned it again from the github repo I'd made. Even after doing that I keep getting that error.
I noticed someone in the Emberjs ember-cli slack channel was getting the same error today. https://embercommunity.slack.com/archives/C045BNHAP/p1528424624000162
So I created a new project from scratch using
MODULE_UNIFICATION=true EMBER_CLI_MODULE_UNIFICATION=true ember new brand-new --yarn
This also has the same issue when running EMBER_CLI_MODULE_UNIFICATION=true ember serve
Which makes me think that a dependency has changed which has broken something else...
Sorry that I have not been able to be more productive in helping-I'd hoped to be able to submit that PR independently, but hopefully at least documenting these issues might be useful information, too.
I started from scratch on a different computer and have submitted this PR which seems to fix the original issue.
For the Cannot read property 'replace' of undefined
problem I'm going to try to understand why that is happening first and if needed raise another issue as I think it's completely unrelated to this.
I think I've now discovered the cause of Cannot read property 'replace' of undefined
and have created a separate issue on the ember-cli repo.
I'm using ember-cli-create
to create an octane app... ember serve
all good, I then installed ember-cli-fastboot
+ prember
, ember serve
again and I'm getting
var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow;
TypeError: Cannot read property 'now' of undefined
@betocantu93, your issue may be caused by the removal of || {}
introduced here? /cc @bekzod
is window
available in fastboot mode ? I removed it because window.performance
is supported on all browsers higher than IE9 https://developer.mozilla.org/en-US/docs/Web/API/Window/performance
@bobisjan thanks, then that is the fault, you can submit PR if you want, it is midnight where I am 😴
No problem, will do 🙂.
I guess it's, thanks!
I think that this is no longer relevant as Module Unification has been discontinued.
If I create a new 'classic layout' Ember application using the latest version of Ember CLI and then installing the latest ember-cli-fastboot like this
Fastboot works — repo available here.
However, if I create a new Ember application with module unification using the latest version of Ember CLI and then installing the latest ember-cli-fastboot like this
Fastboot does not work — repo available here.
I also for good measure updated the version of
ember-source
to the most recent.The server initially runs
But hitting
http://localhost:4200/
returns this error in the console and browserIt seems like there is a problem with the resolver, but I haven't been able to debug it myself.
Any help much appreciated.