thanhtunguet / grapesjs-react

A React wrapper for GrapesJS library
https://thanhtunguet.github.io/grapesjs-react
194 stars 58 forks source link

nameof is not defined #48

Closed phuongEts closed 3 years ago

phuongEts commented 3 years ago

i have issue when install grapesjs react. when i build app it throw bugs "nameof is not defined". please help me fix it!

thanhtunguet commented 3 years ago

Please show the error log to help me know what is happening to you.

Niush commented 3 years ago

This is the line causing the issue in version "3.1.2". Causing nameof is not defined.

https://github.com/thanhtunguet/grapesjs-react/blob/b516f45e127c0a5e323f9cc9b2b1a89436e88687/src/Editor/Editor.tsx#L130

thanhtunguet commented 3 years ago

Please try to upgrade to new version to see if the issue was resolved

gnbrndn commented 3 years ago

Same error with version 3.1.2. Tried the version 4.0.0-alpha, problem was the onInit function was not being called on that version. Peer dependencies and extra config on 3.1.2 would be really helpful.

phuongEts commented 3 years ago

This is the line causing the issue in version "3.1.2". Causing nameof is not defined.

https://github.com/thanhtunguet/grapesjs-react/blob/b516f45e127c0a5e323f9cc9b2b1a89436e88687/src/Editor/Editor.tsx#L130

i upgrade to version 4.0.0-alpha, but same error with old version

thanhtunguet commented 3 years ago

This is the line causing the issue in version "3.1.2". Causing nameof is not defined. https://github.com/thanhtunguet/grapesjs-react/blob/b516f45e127c0a5e323f9cc9b2b1a89436e88687/src/Editor/Editor.tsx#L130

i upgrade to version 4.0.0-alpha, but same error with old version

Have you tried to downgrade to v3.1.1 or the older versions?

thanhtunguet commented 3 years ago

Object.defineProperty(window, nameof(GrapesJS), GrapesJS);

This line is in v3. In v4 I do not use the nameof macro.

Niush commented 3 years ago

Works when downgrading to v3.1.1 Works when updating to 4.0.0-alpha, but causes other breaking changes. (e.g. Editor not exported)

@PhuongTntechs, Downgrading to v3.1.1 is best option.

thanhtunguet commented 3 years ago

Works when downgrading to v3.1.1 Works when updating to 4.0.0-alpha, but causes other breaking changes. (e.g. Editor not exported)

@PhuongTntechs, Downgrading to v3.1.1 is best option.

Thank you @Niush, I will try to fix this v3 issue soon.

thanhtunguet commented 3 years ago

I created a patch 3.1.3 for v3. Commit your changes before try upgrading the package to v3.1.3 to check this issue.