screepers / screeps-typescript-starter

Starter kit for TypeScript-based Screeps AI codes.
https://screepers.gitbook.io/screeps-typescript-starter/
The Unlicense
440 stars 315 forks source link

(commonjs plugin) TypeError: parse is not a function #87

Open bencbartlett opened 6 years ago

bencbartlett commented 6 years ago

Steps to reproduce:

  1. Download the repository and unzip
  2. Navigate to directory and run npm install
  3. Compile with rollup -c

Result:

src/main.ts → dist/main.js...
[!] (commonjs plugin) TypeError: parse is not a function in /Users/ben/Downloads/screeps-typescript-starter-master 2/node_modules/source-map/source-map.js
node_modules/source-map/source-map.js
TypeError: parse is not a function in /Users/ben/Downloads/screeps-typescript-starter-master 2/node_modules/source-map/source-map.js
    at error (/usr/local/lib/node_modules/rollup/dist/rollup.js:169:15)
    at /usr/local/lib/node_modules/rollup/dist/rollup.js:17413:17
    at <anonymous>

TypeScript version: 2.8.3 Node version: 8.10.0

m-rsmn commented 6 years ago

Facing the same issue

Thanks to the screeps slack & Gankdalf

Edit: This seems to have fixed it for me

To fix it temporarily, I added "rollup-plugin-commonjs": "8.3.0" in my devDependencies to override the new version.

(https://github.com/dherges/ng-packagr/issues/657)

Might help you as well @bencbartlett

tcdejong commented 5 years ago

In package.json, change the version for the rollup-plugin-commonjs to 8.1.4, run npm install and you should be golden.