-
Notifications
You must be signed in to change notification settings - Fork 142
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
Ember 4.1+ || Error while processing route: ember window.Ember is undefined -- related: can't access lexical declaration '__WEBPACK_DEFAULT_EXPORT__' before initialization #1038
Comments
if I revert back to Ember |
I confirm the fix by changing the macroCondition to just |
ember-cli-babel ruins lives :( (or maybe just babel) Blocked by: NullVoxPopuli/ember-statechart-component#149 which is in-turn blocked by: emberjs/ember-cli-babel#419 which is then blocked by ember-data... *for some reason*. (I don't use ember-data here, so idgaf) Further work is blocked by embroider-build/embroider#1038
I don't think it's an issue with the SemVer version range itself. Can you debug the |
adding console.logs in node_modules seems to not show anything 🤷 |
ah ha!
I'm falling in to this branch --
(but multiple times)
|
@ef4 would it make sense to fall back to the app's |
In older APIs that we're trying not to break we allow that kind of fallback. But this is new API and we're trying to be strict. Instead we should list ember-source as a peerDep of |
Here is my work-around for now: // @ts-check
'use strict';
const path = require('path');
const fs = require('fs/promises');
const modules = path.join(__dirname, 'node_modules');
/**
* These are patches to packages where things work for
* this project, but I don't yet know what the proper way to fix the issue
* for real is.
*/
async function start() {
await patchEmbroiderIssue1038();
}
async function patchEmbroiderIssue1038() {
console.log('Patching @embroider/util due to https://github.com/embroider-build/embroider/issues/1038');
let emberPrivateApi = path.join(modules, '@embroider/util/addon/ember-private-api.js');
let fileBuffer = await fs.readFile(emberPrivateApi);
let file = fileBuffer.toString();
// the macro-condition for this file doesn't work because embroider can't find
// ember-source.
// since we know that
file = file.replace(/macroCondition\(/, 'true || (');
await fs.writeFile(emberPrivateApi, file);
}
start(); and then in package.json:
|
This is a preliminary issue, but cropped up -- not sure why yet.
There is only one occurrence of
window.Ember
:which comes from:
which is defined here:
embroider/packages/util/addon/ember-private-api.js
Lines 9 to 19 in fb86676
Here is the code / error:
and related error:
The text was updated successfully, but these errors were encountered: