sindresorhus / decamelize-keys

Convert object keys from camel case
MIT License
51 stars 3 forks source link

Webpack: Module parse failed: Identifier directly after number #5

Closed agostinhodev closed 1 year ago

agostinhodev commented 1 year ago

Using Expo web and the decamelize-keys@2.0.1 I'm getting the following error:

index.js:1 ./node_modules/decamelize-keys/index.js 15:40
Module parse failed: Identifier directly after number (15:40)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| });
| 
> const cache = new QuickLru({maxSize: 100_000});
| 
| // Reproduces behavior from `map-obj`.

How to solve?

sindresorhus commented 1 year ago

This is a problem with the Expo build tool not supporting modern JS syntax. Open an issue on Expo instead.

agostinhodev commented 1 year ago

@sindresorhus - Fortunately I found the solution.

I was using @expo/webpack-config in version 0.17.2. However, Expo published a new version of the package, which is 18.0.1. After upgrading to newer version, it works!

As you said, it was an Expo problem!