Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install edited vite.config.js, but didn't add the 'path' and 'vue' import #27

Open
michapietsch-streamline opened this issue Sep 6, 2024 · 2 comments

Comments

@michapietsch-streamline
Copy link

michapietsch-streamline commented Sep 6, 2024

Hey,

I ran php artisan mingle:install, and it added the code to resolve the @mingle alias, as well as the vue plugin, but it failed to add import path from 'path' and import vue from '@vitejs/plugin-vue'.

It was a quick fix, but maybe that's a QOL thing to ensure.

@michapietsch-streamline michapietsch-streamline changed the title Install edited vite.config.js, but didn't add the 'path' import Install edited vite.config.js, but didn't add the 'path' and 'vue' import Sep 6, 2024
@ijpatricio
Copy link
Owner

Thank you for the heads up, @michapietsch-streamline

Let me know if anything more comes by, good or bad 😄

@JackWH
Copy link

JackWH commented Oct 9, 2024

@ijpatricio Hi there! Just wanted to share my experience setting up Mingle for the first time in an existing app. I found three issues, but all were solveable :)

  1. I tried to run php artisan mingle:install but it failed. I don't have a guest layout so hopefully just a check for file existence would solve this.

Screenshot 2024-10-09 at 16 57 30@2x

  1. As well as registering Vite's reactRefresh in Filament (as per docs), I also had to register the stack in Filament's internal layout. I think this was only needed as I'd changed the stack name in the config to avoid a conflict elsewhere:
FilamentView::registerRenderHook(
    'panels::head.end',
    fn(): string => Blade::render("@stack('mingles')")
);
  1. Finally I followed the docs to auto-import mingles in vite.config.js. At first it wasn't finding the test mingle I'd created, but this turned out to be because I'd set the JavaScript file to be called resources/js/MyComponent.js when prompted by php artisan make:mingle. I created a second test component in the alternative suggested structure (resources/js/MyComponent/index.js), and after that it was able to pick this up automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants