NOTE: This issue has since been resolved and this repository has been archived.
This repository was created in response to issue #65 of lamejs. It contains a minimal project that can be used to reproduce the issue.
package.json
: Dependencies and script for running the project.index.ts
: TypeScript file that importslamejs
.index.html
: HTML page that loadsindex.ts
.
lamejs
: The library that contains the issue.parcel
: Bundlesindex.ts
for web use. Note, that the bug occurs whenparcel build
is used (for production ready output), but not withparcel serve
. I have not yet taken steps to further isolate the issue (i.e. removing this dependency).http-server
: Static HTTP server for testing the output ofparcel build
in the browser. It is not related to the issue.
Clone the repository, install dependencies, and run the start
script, which builds the project with parcel
runs http-server
:
git clone https://github.com/eibens/lamejs-issue-65.git
cd lamejs-issue-65
npm install
npm start
Go to http://127.0.0.1:8080 and open the developer console. It should show the following error:
Uncaught ReferenceError: assignment to undeclared variable Lame
Adding var
at the start of lines 17 to 25 in node_modules/lamejs/src/js/index.js
fixes the problem. This solution was proposed in pull request #59 of lamejs.