Parcel: 馃悰 bundle error in `1.3.0`: Cannot read property 'tokens' of undefined

Created on 24 Dec 2017  路  7Comments  路  Source: parcel-bundler/parcel

I got this error when upgrading to 1.3.0
node_modules/react-redux/es/index.js: Cannot read property 'tokens' of undefined

But it works great in 1.2.1

Reproduce Setup

entry.js

import 'react-redux'
$ parcel entry.js
Bug

All 7 comments

I am seeing something similar with another package

index.html

<script src="../node_modules/material-design-lite/material.min.js"></script>

error

Server running at http://localhost:3000
馃毃  /private/tmp/parcel_app/node_modules/material-design-lite/material.min.js: Cannot read property 'tokens' of undefined
    at new Generator (/private/tmp/parcel_app/node_modules/babel-generator/lib/index.js:51:22)
    at exports.default (/private/tmp/parcel_app/node_modules/babel-generator/lib/index.js:19:13)
    at JSAsset.generate (/private/tmp/parcel_app/node_modules/parcel-bundler/src/assets/JSAsset.js:107:9)
    at JSAsset.process (/private/tmp/parcel_app/node_modules/parcel-bundler/src/Asset.js:119:29)
    at <anonymous>

hmm, it seems to work for me. Can you run with --no-cache to see if something there is causing an issue? Otherwise, can you provide a test project that reproduces the issue? Thanks!

I try to create a minimal-project but now seeing a different build error?

https://github.com/rajinder-yadav/parcel_app

Server running at http://localhost:3030
馃毃  /private/tmp/parcel_app/node_modules/material-design-lite/material.min.js: Couldn't find preset "es2015" relative to directory "/private/tmp/parcel_app/no
    at /private/tmp/parcel_app/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19
    at Array.map (<anonymous>)
    at OptionManager.resolvePresets (/private/tmp/parcel_app/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/private/tmp/parcel_app/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/private/tmp/parcel_app/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/private/tmp/parcel_app/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/private/tmp/parcel_app/node_modules/babel-core/lib/transformation/file/index.js:212:65)
    at new File (/private/tmp/parcel_app/node_modules/babel-core/lib/transformation/file/index.js:135:24)
    at JSAsset.getParserOptions (/private/tmp/parcel_app/node_modules/parcel-bundler/src/assets/JSAsset.js:55:20)
    at JSAsset.parse (/private/tmp/parcel_app/node_modules/parcel-bundler/src/assets/JSAsset.js:63:32)

Still get same errors with --no-cache

I get a similar error with moment.js

This is caused by files that are ignored by babel. In that case, babel doesn't return an ast. Should be fixed by 22478d3.

@devongovett Thanks for your work.

Was this page helpful?
0 / 5 - 0 ratings