awcodes / filament-tiptap-editor

A Rich Text Editor plugin for Filament Forms.
MIT License
251 stars 65 forks source link

Unexpected identifier 'Hero'. import call expects one or two arguments. #321

Closed edstevo closed 3 months ago

edstevo commented 5 months ago

Filament Version

3.2.2

Plugin Version

3.2.20

PHP Version

8.2

Problem description

When trying to load a custom extension the module doesn't load correctly.

I followed the Hero example in the documentation, but loading it through the extension.js file produces the attached error.

Screenshot 2024-02-01 at 18 56 19

Expected behavior

I expected the extension to load correctly and trigger correctly from the toolbar.

Steps to reproduce

I followed the Hero example in the documentation. Performed every step.

Reproduction repository

No response

Relevant log output

No response

awcodes commented 5 months ago

Sounds like you missed a step or the extensions.js isn't getting loaded. If you can share a repo I can look more in depth. But I don't have an answer for based on just that error.

edstevo commented 5 months ago

Hi - the extensions.js is getting loaded, you can see it in the screenshot of the browser I attached. The error looks like the browser is struggling with the import "Hero" line. The only thing I can think of is that it is not being compiled by Vite correctly or your app is picking up the raw file rather than the compiled one?

edstevo commented 5 months ago

I've just tried the process in a fresh install and I've got the same error.

You can see the repo here: https://github.com/edstevo/tiptap-test

Can you let me know if you have any issues finding the right bits? I'm sure everything is in the right directories as per the documentation.

Screenshot 2024-02-02 at 12 56 55
awcodes commented 5 months ago

Honestly, I'm not sure what's going on here. If you look at the demo repo, it's working correctly there.

https://github.com/awcodes/tiptap-demo

edstevo commented 5 months ago

Ok, it looks like I have something working now. I'm building vite on each change (npm run build). It doesn't seem to work when using "npm run dev".

awcodes commented 5 months ago

Interesting. I'll make a note to look into it. Thank you for debugging.