dotswan / filament-code-editor

Supercharge Filament with CodeMirror! Effortlessly edit CSS, HTML, JS, JSON, PHP in Filament forms.
MIT License
2 stars 1 forks source link

Uncaught TypeError: Ie is not a constructor #8

Open mrvnklm opened 1 month ago

mrvnklm commented 1 month ago

Using the package I get the following error:

Uncaught TypeError: Ie is not a constructor
    Es http://app.mysite.test/js/dotswan/filament-code-editor/filament-code-editor.js?v=1.1.2.0:23
    render http://app.mysite.test/js/dotswan/filament-code-editor/filament-code-editor.js?v=1.1.2.0:23
    init http://app.mysite.test/js/dotswan/filament-code-editor/filament-code-editor.js?v=1.1.2.0:23
    generateEvaluatorFromFunction http://app.mysite.test/livewire/livewire.js?id=07f22875:1160
    tryCatch http://app.mysite.test/livewire/livewire.js?id=07f22875:1116
    evaluate http://app.mysite.test/livewire/livewire.js?id=07f22875:1140
    <anonymous> http://app.mysite.test/livewire/livewire.js?id=07f22875:3552
    flushHandlers http://app.mysite.test/livewire/livewire.js?id=07f22875:1281
    stopDeferring http://app.mysite.test/livewire/livewire.js?id=07f22875:1286
    deferHandlingDirectives http://app.mysite.test/livewire/livewire.js?id=07f22875:1289
    initTree http://app.mysite.test/livewire/livewire.js?id=07f22875:1476
    start http://app.mysite.test/livewire/livewire.js?id=07f22875:1428
    start http://app.mysite.test/livewire/livewire.js?id=07f22875:1427
    start2 http://app.mysite.test/livewire/livewire.js?id=07f22875:8627
    <anonymous> http://app.mysite.test/livewire/livewire.js?id=07f22875:9886
    EventListener.handleEvent* http://app.mysite.test/livewire/livewire.js?id=07f22875:9882
    <anonymous> http://app.mysite.test/livewire/livewire.js?id=07f22875:9889
[filament-code-editor.js:23:3765](http://app.mysite.test/js/dotswan/filament-code-editor/filament-code-editor.js?v=1.1.2.0)
mohaphez commented 1 month ago

Hi @mrvnklm

can you share your code ?

mrvnklm commented 1 month ago

Sure, sorry for not providing directly:

    public function form(Form $form): Form
    {
        return $form
            ->schema([
                CodeEditor::make('statement')
            ]);
    }
mohaphez commented 1 month ago

Thank you ,
As document says , you need define a unique id . Please try this code :

 public function form(Form $form): Form
    {
        return $form
            ->schema([
                CodeEditor::make('statement')
                             ->id('unique_field_id'),
            ]);
    }

If your problem is not solved or you have other questions Please do not hesitate to inform us.

mrvnklm commented 1 month ago

Thanks, I tried now and I did before just by copy and pasting the sample code. I also get the following warning:

Alpine Expression Error: Ie is not a constructor

Expression: "function(){this.isReadOnly=t,this.theme.dark=n,this.theme.light=r,this.themeConfig=new Si,this.mode="dark",this.render()}"

<div style="overflow: auto;" @theme-changed.window="function(e) {toggleTheme(e.detail)}" x-data="codeEditorFormComponent(…',\n        \n        )">
mohaphez commented 1 month ago

interesting , i use it in my project and everything works fine , one more question . do you have another plugin similar to this plugin installed in your project?

mrvnklm commented 1 month ago

Nothing similar, especially nothing like form fields. I just tried in a different project of mine and there it works, weird. I will look into what causes the issue and give you an update asap.