Unexpected Token when minifying three.js and globe.js
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, node.js, three.js, vite
- Domain
- build-system, tooling
Research direction
Start by reproducing the reported command, browserify -p tinyify index-D9djZuPL.js -o index.js, using the supplied bundle and the versions in package.json. Inspect the generated bundle around the reported parser position and tinyify's handling of it; done means the command completes without the Unexpected token error.
Written by the indexing model from the issue text.
Description
Hello,
Thank you for this awesome tool.
I am receiving the following error when minifying my project:
/home/mina/Documents/PMSoftware/Tender/Tender Attempt - 0003/codebase/globe/node_modules/.pnpm/acorn@7.4.1/node_modules/acorn/dist/acorn.js:2929
throw err
^
SyntaxError: Unexpected token (7:598206)
at pp$4.raise (/home/mina/Documents/PMSoftware/Tender/Tender Attempt - 0003/codebase/globe/node_modules/.pnpm/acorn@7.4.1/node_modules/acorn/dist/acorn.js:2927:15)
at pp.unexpected (/home/mina/Documents/PMSoftware/Tender/Tender Attempt - 0003/codebase/globe/node_modules/.pnpm/acorn@7.4.1/node_modules/acorn/dist/acorn.js:698:10)
at pp$3.parseExprAtom (/home/mina/Documents/PMSoftware/Tender/Tender Attempt - 0003/codebase/globe/node_modules/.pnpm/acorn@7.4.1/node_modules/acorn/dist/acorn.js:2326:12)
at _class.parseExprAtom (/home/mina/Documents/PMSoftware/Tender/Tender Attempt - 0003/codebase/globe/node_modules/.pnpm/acorn-node@1.8.2/node_modules/acorn-node/lib/dynamic-import/index.js:77:117)
at pp$3.parseExprSubscripts (/home/mina/Documents/PMSoftware/Tender/Tender Attempt - 0003/codebase/globe/node_modules/.pnpm/acorn@7.4.1/node_modules/acorn/dist/acorn.js:2129:21)
at pp$3.parseMaybeUnary (/home/mina/Documents/PMSoftware/Tender/Tender Attempt - 0003/codebase/globe/node_modules/.pnpm/acorn@7.4.1/node_modules/acorn/dist/acorn.js:2106:19)
at _class.parseMaybeUnary (/home/mina/Documents/PMSoftware/Tender/Tender Attempt - 0003/codebase/globe/node_modules/.pnpm/acorn-node@1.8.2/node_modules/acorn-node/lib/private-class-elements/index.js:122:54)
at pp$3.parseExprOps (/home/mina/Documents/PMSoftware/Tender/Tender Attempt - 0003/codebase/globe/node_modules/.pnpm/acorn@7.4.1/node_modules/acorn/dist/acorn.js:2041:21)
at pp$3.parseMaybeConditional (/home/mina/Documents/PMSoftware/Tender/Tender Attempt - 0003/codebase/globe/node_modules/.pnpm/acorn@7.4.1/node_modules/acorn/dist/acorn.js:2024:21)
at pp$3.parseMaybeAssign (/home/mina/Documents/PMSoftware/Tender/Tender Attempt - 0003/codebase/globe/node_modules/.pnpm/acorn@7.4.1/node_modules/acorn/dist/acorn.js:1997:21) {
pos: 602507,
loc: Position { line: 7, column: 598206 },
raisedAt: 602508
}
Node.js v22.5.1
Node Version:
node -v
v22.5.1
Command Run:
browserify -p tinyify index-D9djZuPL.js -o index.js
TsConfig:
cat tsconfig.json
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": [
"ES2020",
"DOM",
"DOM.Iterable"
],
"skipLibCheck": true,
"checkJs": false,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"strict": false,
"noUnusedLocals": false,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": [
"src"
]
}
Package.json
cat package.json
{
"name": "globe",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"devDependencies": {
"@types/jquery": "^3.5.30",
"jquery": "^3.7.1",
"tinyify": "^4.0.0",
"typescript": "^5.5.3",
"vite": "^5.4.0"
},
"dependencies": {
"@types/three": "^0.167.1",
"globe.gl": "^2.32.5",
"three": "^0.167.1"
}
}
The file to be minified can be found on: https://drive.google.com/file/d/1DuqHZAO_CDXJm1prnJArkI4cShG9EIkW/view?usp=sharing
Any help would be greatly appreciated
- Dominant language
- JavaScript
- Stars
- 405
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from browserify/tinyify
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
browserify/tinyify#56 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
browserify/tinyify#45 · 1 comment · 2 reactions ·
-
Shakeify issue? Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
browserify/tinyify#26 · 1 comment ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
browserify/tinyify#25 · 9 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
browserify/tinyify#24 · 1 comment ·
All issues in browserify/tinyify
Similar issues
-
bug customer-eng Durable Agents Inngest status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
githubnext/gh-aw-cao#13475 ·
-
[BUG]: "Clear All" in Settings doesn't clear the saved analysis, old data comes back after reload Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
AOSSIE-Org/OrgExplorer#253 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
oxc-project/oxc#26944 ·
-
ai-observability bug team/ai-observability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100