-
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
live reload broken (duplicate scripts like vendor.js appear) #1211
Comments
Seeing this issue as well starting from v1.7.0. Downgrading to v1.6.0 seems to resolve it for now. |
Also seeing this issue. I narrowed it down to @embroider/webpack. Pinning that package to 1.6.0 resolves the problem. |
Most likely culprit is #1177. |
I'm taking a look at this, thank you for the reproduction. |
This error caught me yesterday, but I wanted to report a side effect. I don't know a lot about how yarn's internals work, but I had two apps, one with the embroider addons at |
Edit: I tried pinning livereload-js and terser, but it didn't seem to help. Edit: As ef4 noted below, I was mistaken; this lock file should not affect consuming apps/addons. |
BisectionLooks like bug first occurs in commit `git bisect log`
Process followed for bisection
|
Commenting out these 4 lines makes the problem go away: embroider/packages/webpack/src/ember-webpack.ts Lines 280 to 283 in 7099a11
Maybe somehow we're re-adding the changed files each time? |
I think I figured it out: when we cache/reuse the |
In case it's helpful for anyone, here's a little script to link/unlink each embroider package (not sure if there's an easier way to do this): yarn-link-or-unlink.cjs// yarn-link-or-unlink.cjs
// (assumes __dirname is root of embroider repo)
const { execSync } = require('child_process');
const { readdirSync } = require('fs');
const { argv } = require('process');
const path = require('path');
// change this if you put this script somewhere besides the root of the embroider repo
const embroiderPackagesDir = path.join(__dirname, 'packages');
function log(...args) { console.log(...args); }
const action = argv[2] === 'unlink' ? 'unlink' : 'link';
log(`action = ${action}`);
const packages = readdirSync(embroiderPackagesDir);
log('packages -->', packages);
for (const packageName of packages) {
const packagePath = path.join(embroiderPackagesDir, packageName);
log(`${action}ing ${packageName} (in ${packagePath})`);
execSync(`yarn ${action}`, { cwd: packagePath, encoding: 'utf-8' });
}
const packageListString = packages.map((name) => `@embroider/${name}`).join(' ');
log(`\nRun 'yarn ${action} ${packageListString}' in consuming project to update it`); |
Reproduction: https://github.com/jacobq/embroider-live-reload-bug-repro
Enabling embroider in minimal (ember-cli v4.2.0) app breaks live reload feature. When
ember s
first gets run things are OK. However, changing a file (triggering update/reload) causes something weird to happen such that multiplevendor.js
scripts appear (one gets added after each change/reload).Compare link for v1.6.0 vs v1.7.1 (known good / bad):
v1.6.0...v1.7.1
The text was updated successfully, but these errors were encountered: