parcel: TypeError: Cannot read property 'TYPED_ARRAY_SUPPORT' of undefined #803
🐛 bug report
When I import oidc-client and write “new UserManager({…})” in a parcel bundled project, I get this issue: “Uncaught TypeError: Cannot read property ‘TYPED_ARRAY_SUPPORT’ of undefined” I tried it without parcel and it worked. So the issue should be caused by parcel.
🎛 Configuration (.babelrc, package.json, cli command)
{
"name": "my-project",
"version": "0.1.0",
"license": "UNLICENSED",
"author": "Me",
"scripts": {
"start": "parcel src/index.html --no-cache --port 8080",
"start:build": "http-server dist/ -o",
"build": "parcel build src/index.html --no-cache"
},
"dependencies": {
"lit-element": "^2.1.0",
"oidc-client": "^1.7.0"
},
"devDependencies": {
"http-server": "^0.11.1",
"parcel-bundler": "^1.12.3",
"parcel-plugin-webcomponents": "^1.2.0"
},
"browserslist": [
"last 2 chrome version",
"last 2 firefox version",
"last 2 edge version",
"last 2 safari version",
"not dead"
]
}
🤔 Expected Behavior
oidc-client should just work.
😯 Current Behavior

💁 Possible Solution
No idea
🔦 Context
I just tried to use oidc-client in a parcel bundled project. Everything worked under webpack.
💻 Code Sample
import { UserManager } from 'oidc-client'
const userManager = new UserManager({})
🌍 Your Environment
| Software | Version(s) |
|---|---|
| Parcel | 1.12.3 |
| Node | 11.11.0 |
| npm | 6.7.0 |
| Operating System | Windows 10 |
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 16 (6 by maintainers)
Commits related to this issue
- deleted: sclude parcelとの相性が悪くてビルドできない. そこまでして使いたいほど使い倒す予定無かったので削除. [TypeError: Cannot read property 'TYPED_ARRAY_SUPPORT' of undefined #803 · Issue #2833 · parcel-bundler/parcel](https://github.com/p... — committed to ncaq/goodbye-rfc-2822-date-time by ncaq 5 years ago
- deleted: sclude parcelとの相性が悪くてビルドできない. そこまでして使いたいほど使い倒す予定無かったので削除. [TypeError: Cannot read property 'TYPED_ARRAY_SUPPORT' of undefined #803 · Issue #2833 · parcel-bundler/parcel](https://github.com/p... — committed to alexkoren-dev/goodbye-rfc-chrome-extension by deleted user 5 years ago
Please don’t use
<script type="module">with parcel. There is no reason to do so as Parcel already compiles es6 modules away.The buffer polyfill for browsers contains this code
If you run the parcel script in a
type="module"script (which is unsupported), Parcel can’t get the global object usingthisbecause that’s forbidden in this context. Figuring out the global object is actually not trivial: https://github.com/tc39/proposal-globalDoesn’t work for me… (#1401)