Closed fordiquez closed 6 months ago
You might need to set your app's package.json to use 'module'.
The plugin just loads the file through Vite.
Seems like your script isn't getting processed during the build.
You might need to set your app's package.json to use 'module'.
The plugin just loads the file through Vite.
Seems like your script isn't getting processed during the build.
The package.json has module
Only other issues i've seen like this is that it doesn't work with npm run dev
but does work with npm run build
.
If you can provide a reproduction repo I can investigate further when I get some time.
I encountered the same issue. The script tag is not correctly add to the page html source: `
` As you can see the type=module is missing.
I think the problem was in the vendor/awcodes/filament-tiptap-editor/src/FilamentTiptapEditorServiceProvider.php line 41:
$assets[] = Js::make('tiptap-custom-extension-scripts', Vite::asset(config('filament-tiptap-editor.extensions_script')))->module(true);
If you are running it through Vite though the module shouldn’t matter. I am successfully using it on apps with out module.
Feel free to PR the change and I'll be happy to review it further though.
@awcodes can the PR be merged please? I Have the same issue
as a temporary fix I just removed the script from filament-tiptap-editor.php:
// 'extensions_script' => 'resources/js/tiptap/extensions.js',
and then in my AppServiceProvider:
FilamentAsset::register([Js::make('tiptap-custom-extension-scripts', Vite::asset('resources/js/tiptap/extensions.js'))->module()], 'awcodes/tiptap-editor');
Thank you so much btw @barkoczi, I wasted a lot of time trying to figure out wtf is going on.
Filament Version
v3.2.45
Plugin Version
v.3.2.25
PHP Version
8.2
Problem description
Custom extension is not work correctly.
Expected behavior
Must be worked tiptap extension: https://tiptap.dev/docs/editor/api/nodes/mention
Steps to reproduce
Init custom extension in /resources/js/tiptap/extensions.js
import Mention from "./mention.js";
window.TiptapEditorExtensions = { mention: [Mention] }
/config/filament-tiptap-editor.php 'extensions_script' => 'resources/js/tiptap/extensions.js', 'extensions_styles' => null, 'extensions' => [ [ 'id' => 'mention', 'name' => 'Mention', 'button' => 'mention', 'parser' => \App\TiptapExtensions\Mention::class, ] ],
Reproduction repository
No response
Relevant log output
No response