Open huanglijiao opened 5 years ago
Had similar issues yesterday. Deleted my 'lock' file and node_modules directory, did a fresh install, with the latest version of acorn as a new dependency. Still didn't work. Finally got around it by adding a "resolutions" entry in my package.json, pointing to the scanner's internal version.
"resolutions": {
"i18next-scanner/**/acorn": "6.1.1"
}
Team is went to a holiday? Issue still open! Had the same issue
Team is went to a holiday? Issue still open! Had the same issue
It is open source, therefore you are the team.
@huanglijiao @pinokara
It stated that you might have two acorn copies in your project. https://github.com/acornjs/acorn-private-class-elements/blob/master/index.js#L22-L24
if (cur !== acorn.Parser) {
throw new Error("acorn-private-class-elements does not support mixing different acorn copies")
}
Try npm ls
to see all the occurrences in the dependency tree.
Remove both node_modules
and package-lock.json
and do a fresh install should work.
gulpfile.js:
[16:17:08] Using gulpfile /Applications/hust-dev/joox-web-nextjs/gulpfile.js [16:17:08] Starting 'i18next'... i18next-scanner: Unable to parse Trans component from "/Applications/hust-dev/joox-web-nextjs/pages/_app.js" Error: acorn-private-class-elements does not support mixing different acorn copies i18next-scanner: Unable to parse Trans component from "/Applications/hust-dev/joox-web-nextjs/pages/_error.js" Error: acorn-private-class-elements does not support mixing different acorn copies i18next-scanner: Unable to parse Trans component from "/Applications/hust-dev/joox-web-nextjs/pages/index.js" Error: acorn-private-class-elements does not support mixing different acorn copies i18next-scanner: Unable to parse Trans component from "/Applications/hust-dev/joox-web-nextjs/pages/second-page.js" Error: acorn-private-class-elements does not support mixing different acorn copies [16:17:08] Finished 'i18next' after 54 ms [16:17:08] Starting 't'... [16:17:08] Finished 't' after 44 μs