Open Kurolox opened 1 year ago
That's very weird... afaik we didn't change any deps related to js parsing :-?
@Kurolox if you revert back to v0.82.1, does it work?
The more I'm looking into this, the more of a nightmare its becoming. It seems like the package manager used influences the outcome
NPM | PNPM | Yarn | |
---|---|---|---|
v0.65.3 | β | β | β |
v0.66.0 | β | ? | ? |
v0.67.0 | β2 | ? | ? |
v0.75.3 | β2 | β | β |
v0.80.0 | β | ? | ? |
v0.81.1 | β | ? | ? |
v0.82.0 | β | β | β |
v0.82.5 | β1 | β | β |
v0.82.5 (again?) | β | β | β |
Legend:
Here are the relevant logs for the third category.
1: NOTE: This has been fixed, it was caused due to the alias
section in the package.lock
π£ Plasmo v0.82.5
π΄ The Browser Extension Framework
π΅ INFO | Starting the extension development server...
π‘ 1 | Starting dev server on localhost:41277, HMR on localhost:1815...
π‘ 2 | Creating Manifest Factory...
π‘ 3 | Loaded env from .env
π‘ 4 | Ensure exists: /home/kuro/projects/browser-extension/.plasmo
π‘ 5 | /home/kuro/projects/browser-extension/assets/icon512.png found, creating resized icons
π‘ 6 | Loaded env from .env
π‘ 7 | Creating static templates for popup
π‘ 8 | Creating static templates for options
π‘ 9 | Creating static templates for newtab
π‘ 10 | Creating static templates for devtools
π‘ 11 | Creating static templates for sidepanel
π‘ 12 | Parsed config: {
matches: [
'https://example.com/*',
]
}
π‘ 13 | Adding content script: /home/kuro/projects/browser-extension/src/contents/default.tsx
π‘ 14 | Creating content script mount for contents
π‘ 15 | Parsed config: { matches: [ 'https://www.example.com/*' ] }
π‘ 16 | Adding content script: /home/kuro/projects/browser-extension/src/contents/example.tsx
π‘ 17 | Creating content script mount for contents
π‘ 18 | Adding content script: /home/kuro/projects/browser-extension/src/contents/configs/index.ts
π‘ 19 | { messageHandlerList: [], portHandlerList: [] }
π‘ 20 | Creating BGSW entry
π‘ 21 | Hash changed, updating manifest
π‘ 22 | Watching the following files: Set(135) {
'/home/kuro/projects/browser-extension/package.json',
'/home/kuro/projects/browser-extension/src/.env.chrome.local',
'/home/kuro/projects/browser-extension/src/.env.dev.local',
'/home/kuro/projects/browser-extension/src/.env.development.local',
'/home/kuro/projects/browser-extension/src/.env.local',
'/home/kuro/projects/browser-extension/src/.env.chrome',
'/home/kuro/projects/browser-extension/src/.env.dev',
'/home/kuro/projects/browser-extension/src/.env.development',
'/home/kuro/projects/browser-extension/src/.env',
'/home/kuro/projects/browser-extension/src/content.chrome.ts',
'/home/kuro/projects/browser-extension/src/content.development.ts',
'/home/kuro/projects/browser-extension/src/content.ts',
'/home/kuro/projects/browser-extension/src/content.chrome.tsx',
'/home/kuro/projects/browser-extension/src/content.development.tsx',
'/home/kuro/projects/browser-extension/src/content.tsx',
'/home/kuro/projects/browser-extension/src/content.chrome.jsx',
'/home/kuro/projects/browser-extension/src/content.development.jsx',
'/home/kuro/projects/browser-extension/src/content.jsx',
'/home/kuro/projects/browser-extension/src/content.chrome.js',
'/home/kuro/projects/browser-extension/src/content.development.js',
'/home/kuro/projects/browser-extension/src/content.js',
'/home/kuro/projects/browser-extension/src/sandbox.chrome.ts',
'/home/kuro/projects/browser-extension/src/sandbox.development.ts',
'/home/kuro/projects/browser-extension/src/sandbox.ts',
'/home/kuro/projects/browser-extension/src/sandbox.chrome.tsx',
'/home/kuro/projects/browser-extension/src/sandbox.development.tsx',
'/home/kuro/projects/browser-extension/src/sandbox.tsx',
'/home/kuro/projects/browser-extension/src/sandbox.chrome.jsx',
'/home/kuro/projects/browser-extension/src/sandbox.development.jsx',
'/home/kuro/projects/browser-extension/src/sandbox.jsx',
'/home/kuro/projects/browser-extension/src/sandbox.chrome.js',
'/home/kuro/projects/browser-extension/src/sandbox.development.js',
'/home/kuro/projects/browser-extension/src/sandbox.js',
'/home/kuro/projects/browser-extension/src/background.chrome.ts',
'/home/kuro/projects/browser-extension/src/background/index.chrome.ts',
'/home/kuro/projects/browser-extension/src/background.development.ts',
'/home/kuro/projects/browser-extension/src/background/index.development.ts',
'/home/kuro/projects/browser-extension/src/background.ts',
'/home/kuro/projects/browser-extension/src/background/index.ts',
'/home/kuro/projects/browser-extension/src/background.chrome.js',
'/home/kuro/projects/browser-extension/src/background/index.chrome.js',
'/home/kuro/projects/browser-extension/src/background.development.js',
'/home/kuro/projects/browser-extension/src/background/index.development.js',
'/home/kuro/projects/browser-extension/src/background.js',
'/home/kuro/projects/browser-extension/src/background/index.js',
'/home/kuro/projects/browser-extension/src/popup.chrome.tsx',
'/home/kuro/projects/browser-extension/src/popup/index.chrome.tsx',
'/home/kuro/projects/browser-extension/src/popup.development.tsx',
'/home/kuro/projects/browser-extension/src/popup/index.development.tsx',
'/home/kuro/projects/browser-extension/src/popup.tsx',
'/home/kuro/projects/browser-extension/src/popup/index.tsx',
'/home/kuro/projects/browser-extension/src/popup.chrome.jsx',
'/home/kuro/projects/browser-extension/src/popup/index.chrome.jsx',
'/home/kuro/projects/browser-extension/src/popup.development.jsx',
'/home/kuro/projects/browser-extension/src/popup/index.development.jsx',
'/home/kuro/projects/browser-extension/src/popup.jsx',
'/home/kuro/projects/browser-extension/src/popup/index.jsx',
'/home/kuro/projects/browser-extension/src/options.chrome.tsx',
'/home/kuro/projects/browser-extension/src/options/index.chrome.tsx',
'/home/kuro/projects/browser-extension/src/options.development.tsx',
'/home/kuro/projects/browser-extension/src/options/index.development.tsx',
'/home/kuro/projects/browser-extension/src/options.tsx',
'/home/kuro/projects/browser-extension/src/options/index.tsx',
'/home/kuro/projects/browser-extension/src/options.chrome.jsx',
'/home/kuro/projects/browser-extension/src/options/index.chrome.jsx',
'/home/kuro/projects/browser-extension/src/options.development.jsx',
'/home/kuro/projects/browser-extension/src/options/index.development.jsx',
'/home/kuro/projects/browser-extension/src/options.jsx',
'/home/kuro/projects/browser-extension/src/options/index.jsx',
'/home/kuro/projects/browser-extension/src/devtools.chrome.tsx',
'/home/kuro/projects/browser-extension/src/devtools/index.chrome.tsx',
'/home/kuro/projects/browser-extension/src/devtools.development.tsx',
'/home/kuro/projects/browser-extension/src/devtools/index.development.tsx',
'/home/kuro/projects/browser-extension/src/devtools.tsx',
'/home/kuro/projects/browser-extension/src/devtools/index.tsx',
'/home/kuro/projects/browser-extension/src/devtools.chrome.jsx',
'/home/kuro/projects/browser-extension/src/devtools/index.chrome.jsx',
'/home/kuro/projects/browser-extension/src/devtools.development.jsx',
'/home/kuro/projects/browser-extension/src/devtools/index.development.jsx',
'/home/kuro/projects/browser-extension/src/devtools.jsx',
'/home/kuro/projects/browser-extension/src/devtools/index.jsx',
'/home/kuro/projects/browser-extension/src/newtab.chrome.tsx',
'/home/kuro/projects/browser-extension/src/newtab/index.chrome.tsx',
'/home/kuro/projects/browser-extension/src/newtab.development.tsx',
'/home/kuro/projects/browser-extension/src/newtab/index.development.tsx',
'/home/kuro/projects/browser-extension/src/newtab.tsx',
'/home/kuro/projects/browser-extension/src/newtab/index.tsx',
'/home/kuro/projects/browser-extension/src/newtab.chrome.jsx',
'/home/kuro/projects/browser-extension/src/newtab/index.chrome.jsx',
'/home/kuro/projects/browser-extension/src/newtab.development.jsx',
'/home/kuro/projects/browser-extension/src/newtab/index.development.jsx',
'/home/kuro/projects/browser-extension/src/newtab.jsx',
'/home/kuro/projects/browser-extension/src/newtab/index.jsx',
'/home/kuro/projects/browser-extension/src/sidepanel.chrome.tsx',
'/home/kuro/projects/browser-extension/src/sidepanel/index.chrome.tsx',
'/home/kuro/projects/browser-extension/src/sidepanel.development.tsx',
'/home/kuro/projects/browser-extension/src/sidepanel/index.development.tsx',
'/home/kuro/projects/browser-extension/src/sidepanel.tsx',
'/home/kuro/projects/browser-extension/src/sidepanel/index.tsx',
'/home/kuro/projects/browser-extension/src/sidepanel.chrome.jsx',
... 35 more items
}
π΅ INFO | Loaded environment variables from: [ '.env' ]
π΄ ERROR | Failed to resolve '.plasmo/chrome-mv3.plasmo.manifest.json'
2: NOTE: This issue has been fixed already at some point, so it can be safely disregarded
π£ Plasmo v0.75.3
π΄ The Browser Extension Framework
π WARN | A new version of plasmo is available: v0.82.5
| Run "pnpm i plasmo@0.82.5" to update
π΅ INFO | Starting the extension development server...
π‘ 1 | Creating Manifest Factory...
π‘ 2 | Loaded env from .env
π‘ 3 | Ensure exists: /home/kuro/projects/browser-extension/.plasmo
π‘ 4 | Plasmo version file not found, busting cache...
π‘ 5 | /home/kuro/projects/browser-extension/assets/icon512.png found, creating resized icons
π‘ 6 | Loaded env from .env
π‘ 7 | Creating static templates for popup
π‘ 8 | Creating static templates for options
π‘ 9 | Creating static templates for newtab
π‘ 10 | Creating static templates for devtools
π‘ 11 | Parsed config: { matches: [ 'https://www.example.com/*' ] }
π‘ 12 | Adding content script: /home/kuro/projects/browser-extension/src/contents/example.tsx
π‘ 13 | Creating content script mount for contents
π‘ 14 | Parsed config: {
matches: [
'https://example.com/*',
]
}
π‘ 15 | Adding content script: /home/kuro/projects/browser-extension/src/contents/default.tsx
π‘ 16 | Creating content script mount for contents
π‘ 17 | { messageHandlerList: [], portHandlerList: [] }
π‘ 18 | Creating BGSW entry
π‘ 19 | Hash changed, updating manifest
π‘ 20 | Watching the following files: Set(117) {
'/home/kuro/projects/browser-extension/package.json',
'/home/kuro/projects/browser-extension/src/.env.chrome.local',
'/home/kuro/projects/browser-extension/src/.env.dev.local',
'/home/kuro/projects/browser-extension/src/.env.development.local',
'/home/kuro/projects/browser-extension/src/.env.local',
'/home/kuro/projects/browser-extension/src/.env.chrome',
'/home/kuro/projects/browser-extension/src/.env.dev',
'/home/kuro/projects/browser-extension/src/.env.development',
'/home/kuro/projects/browser-extension/src/.env',
'/home/kuro/projects/browser-extension/src/content.chrome.ts',
'/home/kuro/projects/browser-extension/src/content.development.ts',
'/home/kuro/projects/browser-extension/src/content.ts',
'/home/kuro/projects/browser-extension/src/content.chrome.tsx',
'/home/kuro/projects/browser-extension/src/content.development.tsx',
'/home/kuro/projects/browser-extension/src/content.tsx',
'/home/kuro/projects/browser-extension/src/content.chrome.jsx',
'/home/kuro/projects/browser-extension/src/content.development.jsx',
'/home/kuro/projects/browser-extension/src/content.jsx',
'/home/kuro/projects/browser-extension/src/content.chrome.js',
'/home/kuro/projects/browser-extension/src/content.development.js',
'/home/kuro/projects/browser-extension/src/content.js',
'/home/kuro/projects/browser-extension/src/sandbox.chrome.ts',
'/home/kuro/projects/browser-extension/src/sandbox.development.ts',
'/home/kuro/projects/browser-extension/src/sandbox.ts',
'/home/kuro/projects/browser-extension/src/sandbox.chrome.tsx',
'/home/kuro/projects/browser-extension/src/sandbox.development.tsx',
'/home/kuro/projects/browser-extension/src/sandbox.tsx',
'/home/kuro/projects/browser-extension/src/sandbox.chrome.jsx',
'/home/kuro/projects/browser-extension/src/sandbox.development.jsx',
'/home/kuro/projects/browser-extension/src/sandbox.jsx',
'/home/kuro/projects/browser-extension/src/sandbox.chrome.js',
'/home/kuro/projects/browser-extension/src/sandbox.development.js',
'/home/kuro/projects/browser-extension/src/sandbox.js',
'/home/kuro/projects/browser-extension/src/background.chrome.ts',
'/home/kuro/projects/browser-extension/src/background/index.chrome.ts',
'/home/kuro/projects/browser-extension/src/background.development.ts',
'/home/kuro/projects/browser-extension/src/background/index.development.ts',
'/home/kuro/projects/browser-extension/src/background.ts',
'/home/kuro/projects/browser-extension/src/background/index.ts',
'/home/kuro/projects/browser-extension/src/background.chrome.js',
'/home/kuro/projects/browser-extension/src/background/index.chrome.js',
'/home/kuro/projects/browser-extension/src/background.development.js',
'/home/kuro/projects/browser-extension/src/background/index.development.js',
'/home/kuro/projects/browser-extension/src/background.js',
'/home/kuro/projects/browser-extension/src/background/index.js',
'/home/kuro/projects/browser-extension/src/popup.chrome.tsx',
'/home/kuro/projects/browser-extension/src/popup/index.chrome.tsx',
'/home/kuro/projects/browser-extension/src/popup.development.tsx',
'/home/kuro/projects/browser-extension/src/popup/index.development.tsx',
'/home/kuro/projects/browser-extension/src/popup.tsx',
'/home/kuro/projects/browser-extension/src/popup/index.tsx',
'/home/kuro/projects/browser-extension/src/popup.chrome.jsx',
'/home/kuro/projects/browser-extension/src/popup/index.chrome.jsx',
'/home/kuro/projects/browser-extension/src/popup.development.jsx',
'/home/kuro/projects/browser-extension/src/popup/index.development.jsx',
'/home/kuro/projects/browser-extension/src/popup.jsx',
'/home/kuro/projects/browser-extension/src/popup/index.jsx',
'/home/kuro/projects/browser-extension/src/options.chrome.tsx',
'/home/kuro/projects/browser-extension/src/options/index.chrome.tsx',
'/home/kuro/projects/browser-extension/src/options.development.tsx',
'/home/kuro/projects/browser-extension/src/options/index.development.tsx',
'/home/kuro/projects/browser-extension/src/options.tsx',
'/home/kuro/projects/browser-extension/src/options/index.tsx',
'/home/kuro/projects/browser-extension/src/options.chrome.jsx',
'/home/kuro/projects/browser-extension/src/options/index.chrome.jsx',
'/home/kuro/projects/browser-extension/src/options.development.jsx',
'/home/kuro/projects/browser-extension/src/options/index.development.jsx',
'/home/kuro/projects/browser-extension/src/options.jsx',
'/home/kuro/projects/browser-extension/src/options/index.jsx',
'/home/kuro/projects/browser-extension/src/devtools.chrome.tsx',
'/home/kuro/projects/browser-extension/src/devtools/index.chrome.tsx',
'/home/kuro/projects/browser-extension/src/devtools.development.tsx',
'/home/kuro/projects/browser-extension/src/devtools/index.development.tsx',
'/home/kuro/projects/browser-extension/src/devtools.tsx',
'/home/kuro/projects/browser-extension/src/devtools/index.tsx',
'/home/kuro/projects/browser-extension/src/devtools.chrome.jsx',
'/home/kuro/projects/browser-extension/src/devtools/index.chrome.jsx',
'/home/kuro/projects/browser-extension/src/devtools.development.jsx',
'/home/kuro/projects/browser-extension/src/devtools/index.development.jsx',
'/home/kuro/projects/browser-extension/src/devtools.jsx',
'/home/kuro/projects/browser-extension/src/devtools/index.jsx',
'/home/kuro/projects/browser-extension/src/newtab.chrome.tsx',
'/home/kuro/projects/browser-extension/src/newtab/index.chrome.tsx',
'/home/kuro/projects/browser-extension/src/newtab.development.tsx',
'/home/kuro/projects/browser-extension/src/newtab/index.development.tsx',
'/home/kuro/projects/browser-extension/src/newtab.tsx',
'/home/kuro/projects/browser-extension/src/newtab/index.tsx',
'/home/kuro/projects/browser-extension/src/newtab.chrome.jsx',
'/home/kuro/projects/browser-extension/src/newtab/index.chrome.jsx',
'/home/kuro/projects/browser-extension/src/newtab.development.jsx',
'/home/kuro/projects/browser-extension/src/newtab/index.development.jsx',
'/home/kuro/projects/browser-extension/src/newtab.jsx',
'/home/kuro/projects/browser-extension/src/newtab/index.jsx',
'/home/kuro/projects/browser-extension/src/popup.chrome.html',
'/home/kuro/projects/browser-extension/src/popup/index.chrome.html',
'/home/kuro/projects/browser-extension/src/popup.development.html',
'/home/kuro/projects/browser-extension/src/popup/index.development.html',
'/home/kuro/projects/browser-extension/src/popup.html',
'/home/kuro/projects/browser-extension/src/popup/index.html',
'/home/kuro/projects/browser-extension/src/options.chrome.html',
... 17 more items
}
π‘ 21 | Starting dev server on 33097, HMR on 1815...
π΅ INFO | Loaded environment variables from: [ '.env' ]
node:internal/per_context/domexception:53
ErrorCaptureStackTrace(this);
^
DOMException [DataCloneError]: function fn(...args) {
return new Promise((resolve, reject) => {
ArrayPrototypePush(args, (err, ...va...<omitted>... } could not be cloned.
at new DOMException (node:internal/per_context/domexception:53:5)
at Worker.postMessage (node:internal/worker:378:5)
at ThreadsWorker.send (/home/kuro/projects/browser-extension/node_modules/@plasmohq/parcel-core/node_modules/@parcel/workers/lib/threads/ThreadsWorker.js:58:17)
at Worker.send (/home/kuro/projects/browser-extension/node_modules/@plasmohq/parcel-core/node_modules/@parcel/workers/lib/Worker.js:124:17)
at Worker.call (/home/kuro/projects/browser-extension/node_modules/@plasmohq/parcel-core/node_modules/@parcel/workers/lib/Worker.js:141:12)
at /home/kuro/projects/browser-extension/node_modules/@plasmohq/parcel-core/node_modules/@parcel/workers/lib/Worker.js:113:12
at new Promise (<anonymous>)
at Worker.sendSharedReference (/home/kuro/projects/browser-extension/node_modules/@plasmohq/parcel-core/node_modules/@parcel/workers/lib/Worker.js:112:12)
at /home/kuro/projects/browser-extension/node_modules/@plasmohq/parcel-core/node_modules/@parcel/workers/lib/Worker.js:103:20
at Array.map (<anonymous>)
Node.js v20.5.1
Lastly, this is the package.json
that was used during all of my testing (besides the plasmo version changes between them)
{
"name": "examplet-extension",
"displayName": "Example Extension",
"version": "1.0.0",
"description": "An example extension",
"author": "Kurolox",
"scripts": {
"dev": "LIVE_ENV_SWAP=1 plasmo dev --verbose",
"dev-ff": "plasmo dev --target=firefox-mv2",
"build:dev": "LIVE_ENV_SWAP=1 plasmo build",
"build:prod": "plasmo build --tag prod",
"lint": "npx eslint 'src/**/*.{ts,tsx}' && tsc --noEmit",
"lint:fix": "npx eslint 'src/**/*.{ts,tsx}' --fix",
"format": "prettier --write '**/*.{ts,tsx,scss}'",
"package": "./publish.sh",
"cleanup": "rm -rf node_modules .plasmo build"
},
"dependencies": {
"@plasmohq/storage": "^0.8.1",
"@reduxjs/toolkit": "^1.8.3",
"@sentry/react": "^7.12.1",
"bemify-js": "^0.3.0",
"lodash": "^4.17.21",
"oidc-client-ts": "^2.2.5",
"parse-domain": "^7.0.1",
"react": "file:../react/node_modules/react",
"react-bootstrap": "^2.4.0",
"react-dom": "file:../react/node_modules/react-dom",
"react-draggable": "^4.4.5",
"react-oidc-context": "^2.3.0",
"react-rating": "^2.0.5",
"react-redux": "^8.0.2",
"helper-library": "file:../react"
},
"devDependencies": {
"@parcel/transformer-sass": "2.6.2",
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
"@types/chrome": "0.0.188",
"@types/node": "17.0.40",
"@types/react": "18.0.12",
"@types/react-dom": "18.0.5",
"@types/redux-logger": "^3.0.9",
"@typescript-eslint/eslint-plugin": "^5.37.0",
"@typescript-eslint/parser": "^5.37.0",
"eslint": "^8.23.1",
"eslint-plugin-react": "^7.31.8",
"husky": "4.3.8",
"lint-staged": "^13.0.3",
"plasmo": "^0.75.0",
"prettier": "^2.7.1",
"querystring-es3": "^0.2.1",
"redux-logger": "^3.0.6",
"sass": "^1.52.3",
"typescript": "4.7.3"
},
"alias": {
"@images": "./assets/images"
},
"lint-staged": {
"*.{ts,tsx}": [
"prettier --write",
"eslint"
],
"*.scss": [
"prettier --write"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"manifest": {
"host_permissions": [
"*://fonts.googleapis.com/*"
],
"permissions": [
"storage",
"tabs"
],
"content_security_policy": {
"extension_pages": "style-src 'self' fonts.cdnfonts.com fonts.googleapis.com;font-src 'self' fonts.gstatic.com fonts.cdnfonts.com;object-src 'self';default-src 'self' http://localhost:* ws://localhost:*;"
}
}
}
While I was experimenting with different version of plasmo I ended up fixing one of the errors, it was caused due to the alias
section of the package.json
. So right now, I've been able to get plasmo working in v0.82.5
, with the caveat that I've been able to do this exclusively with npm
I believe that there's something wrong with my current setup that makes yarn
and pnpm
behave erratically when compared to npm
, and I assume that a dependency being handled differently between all three package managers are displaying that behavior.
I wouldn't give too much thought at the other error because it seems like it was fixed at some point.
So, TL;DR: Ignore plasmo versions, it seems like npm
is acting different than pnpm
and yarn
. I'd like to figure out what could be that difference so I can migrate to pnpm
What happened?
Running Plasmo v0.82.5. The error is not exclusive to that particular file, but there is something wrong going on with jsx parsing, plasmo seems to expect some jsx tags to be inmediately closed without any props.
Here's an example (it's the one mentioned in the logs attached)
To give a bit more context, that's the
react-bootstrap
Overlay component, which is expected to have props. Even if I get rid of this specific issue by removing all props to see if at least it would compile, plasmo only complains about a different file, so it doesn't seem to be related to the components themselvesAny idea about what could be causing this issue?
Version
Latest
What OS are you seeing the problem on?
Linux
What browsers are you seeing the problem on?
No response
Relevant log output
(OPTIONAL) Contribution
Code of Conduct