-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
"Could not resolve bundle with id" [BUG] #661
Comments
@ar7casper can you provide a reproduction repo |
can you comeup with fix? this is my issue too |
import type {
PlasmoCSConfig,
PlasmoCSUIJSXContainer,
PlasmoCSUIProps,
PlasmoRender,
} from 'plasmo';
import type { FC } from 'react';
import { createRoot } from 'react-dom/client';
import './style.css';
import { App } from '~components';
// Specific Url Where Extension Injects
export const config: PlasmoCSConfig = {
matches: ['https://www.youtube.com/watch*'],
};
// Youtube Sidebar Root
export const getRootContainer = () =>
new Promise((resolve) => {
const checkInterval = setInterval(() => {
const rootContainerParent = document.querySelector('#secondary'); // Sidebar Id
if (rootContainerParent) {
clearInterval(checkInterval);
const rootContainer = document.createElement('div');
rootContainerParent.insertBefore(
rootContainer,
rootContainerParent.firstChild
);
resolve(rootContainer);
}
}, 137);
});
// Starting Point
const PlasmoOverlay: FC<PlasmoCSUIProps> = () => {
return <App />;
};
// React Render
export const render: PlasmoRender<PlasmoCSUIJSXContainer> = async ({
createRootContainer,
}) => {
const rootContainer = await createRootContainer();
const root = createRoot(rootContainer);
root.render(<PlasmoOverlay />);
};
export default PlasmoOverlay; this is my starting point on content.tsx, it works really well on dev mode, but on build and package it says: |
Seeing this as well, only after building the extension, not in dev mode. I'm pretty sure it is coming from parcel ( Update: maybe this is related to Parcel Bundler#7609 |
Same issue here. We use the https://docs.plasmo.com/framework/customization/src |
Thanks, that worked. |
thank that work for me too |
Hm, seems to be fixed with the latest plasmo version, which uses @parcel/runtime-js 2.9.3. |
Having this issue all of a sudden too. |
for pnpm
@DanielRuf thanks a lot. |
Im facing this currently as well (works in dev, get the error on prod build). |
@ashwanth1109 the comment covers the pnpm package manager. Do you use pnpm, yarn or npm (and which version)? For yarn please see #661 (comment) |
@DanielRuf , I'm using pnpm v8.6.12 and I tried pnpm overrides in package.json mentioned in an earlier comment |
@ashwanth1109 hm, interesting. Maybe there is some bug in your version or you have to delete node_modules and try again. Best is to ask in the pnpm community for help. |
Started getting it today myself. Took a while to find this thread, and thankfully this fixed it. Commenting here so I can watch for resolution to remove this hack from my project. Very frustratingly, I couldn't reproduce it when running in dev mode with |
This resolved my issue. 👍 What I encounter is, when I import some image eg. |
@DanielRuf , thanks for you response! 👍🏾 |
This is tricky..... thanks all for the report. So the latest 2.9.3 runtime-js is now following strict ESM resolve with the requirement of package.json needs to have proper Now, the boggling thing is that... most npm package import paths are still relying on the old CJS resolution algo, so the latest parcel resolver will break a lot of projects. The main PROS of the latest js-transformer is that it's rewritten in RUST and is supposed to be much faster... I think the decision here would be to just revert course back to the 2.8.3 packager until they ironed out their techdebt?... OR should we try to migrate everything to module/ESM? The latter will force deprecation many npm cjs packages that'd otherwise be usable in a framework like NextJS. I think Plasmo framework should be more backward compatible. However it's just me maintaining the core project so it's tough to polyfill/rewrite/maintain backward compatibility code... (Which are core business unit for MSFT and NextJS itself as well, I think). If the community is down to help out investigating a way to have backward compatibility between CJS and ESM import resolution, that'd be great. But otherwise, I think we should revert to 2.8.3 and freeze it there for now? |
I would vote for "revert to 2.8.3 and freeze / pin". |
I had this on v0.83 of plasmo but v0.84 seems to fix it |
I'm getting the same error on plasmo v0.84. Uncaught Error: Could not resolve bundle with id bPa86 When using EDIT : |
Encountering the same error persistently: Issue: Details: Observations: Environment:
Additionally, the pnpm override for @parcel/runtime-js is not functioning as expected. Worth to mention that the |
What happened?
A bug happened!
I've built an extension, and I'm getting this error when running the extension -
"Could not resolve bundle with id"
Version
Latest
What OS are you seeing the problem on?
MacOSX
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
(OPTIONAL) Contribution
Code of Conduct
The text was updated successfully, but these errors were encountered: