brainfoolong / form-data-json

A zero dependency, cross browser library to easily get or set/manipulate form input values as/from a json object.
https://brainfoolong.github.io/form-data-json
MIT License
57 stars 10 forks source link

Module parse failed: Unexpected token (15:30) #32

Closed KES777 closed 1 year ago

KES777 commented 1 year ago

Describe the bug

Message:
    ./src/js/common/form-data-json.cjs 15:30
Module parse failed: Unexpected token (15:30)
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
|    * @type {{}}
|    */
>   static defaultOptionsToJson = {
|     /**
|      * Include all disabled field values
 @ ./src/js/common/form-data-json-exposed.cjs 1:33-66
 @ ./src/js/modal.js
Details:
    domainEmitter: [object Object]
    domainThrown: false

To Reproduce Unknown. Just upgraded from 2.1.3 to 2.1.4

Probably there is problem with my tooling, but there is no any notices about requirements at changelog.

brainfoolong commented 1 year ago

Hi. There are no significant changes from 2.1.3 to 2.1.4. Can you please attach the file what you are trying to compile? Are there 2 files, form-data-json.cjs and form-data-json-exposed.cjs ?

KES777 commented 1 year ago

https://github.com/brainfoolong/form-data-json/blob/master/src/form-data-json.js

brainfoolong commented 1 year ago

Well, then it must be something in your webpack config. I've never used webpack, so i can't help here.

The file you have posted it the source for our distribution and release files and this works fine, even with latest master or latest release. Maybe you are better to go with a "dist" file from the latest release instead of the source file, because they are already compiled.

https://github.com/brainfoolong/form-data-json/releases

KES777 commented 1 year ago

Thank you very much. That was my fault. I was downloaded file from wrong place. When I downloaded code from link you have provided, every thing work fine.