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

/canvas-ui is blank #1181

Closed
1 task done
adrelliott opened this issue Dec 13, 2022 · 6 comments
Closed
1 task done

/canvas-ui is blank #1181

adrelliott opened this issue Dec 13, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@adrelliott
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I install canvas-ui, and visit this in the browser:

/canvas-ui

I just get a blank page.

Expected Behavior

I was expecting to see a front end. (Maybe I've misunderstood what canvas-ui command does!)

Steps To Reproduce

In local, install canvas via composer

Run the install comand

run php artisan canvas:ui
run npm install
run npm run dev

Create a demo post

Go to /canvas-ui and see bank screen

Environment

PHP 8.1.7
LARAVEL v9.43.0
MySql

Anything else?

I'm pretty sure it;s something I'm doing wrong here!

@adrelliott adrelliott added the bug Something isn't working label Dec 13, 2022
@mdrdani
Copy link

mdrdani commented Dec 14, 2022

Same bug with Laravel 9, and I change to Laravel 8 its work canvas-ui

@austintoddj
Copy link
Owner

austintoddj commented Dec 15, 2022

Are you using Vite to compile the assets?

@adrelliott @mdrdani I repro'd the issue, and it's due to Laravel 9 shifting from Mix to Vite to compile assets.

Follow these steps to resolve your issue:

Pull Laravel Mix into the project:

npm install laravel-mix --save-dev

Ensure your webpack.mix.js file has the following lines:

const mix = require('laravel-mix');

mix.js('resources/js/canvas-ui/app.js', 'public/js/canvas-ui.js').vue()
    .sass('resources/sass/canvas-ui.scss', 'public/css/canvas-ui.css');

Add the following lines to the script block in package.json:

"canvas.ui.dev": "mix",
"canvas.ui.prod": "mix"

Run npm run canvas.ui.dev to compile the assets.

@othmoz
Copy link

othmoz commented Jan 26, 2023

do you plan to add support for vite as it's the preferred way going forward with Laravel ?

@austintoddj
Copy link
Owner

@othmoz The next version of Canvas (v7.0) isn't going to make CanvasUI an SPA. There won't be any added dependencies and build, it's going to be traditional Blade files which will be simpler to work with and modify. So in a way, yes, Canvas won't care if you use Vite.

@othmoz
Copy link

othmoz commented Jan 27, 2023 via email

@austintoddj
Copy link
Owner

@othmoz I don't have a definitive date set at the moment, but aiming for the next few months.

austintoddj added a commit that referenced this issue Jun 22, 2023
* hotfix/6.0.47:
  builds assets
  Apply fixes from StyleCI (#1304)
  adds laravel mix and node scripts to fix #1181
  uses an svg instead of an icon #1300
  updates dependencies and compiles assets
  updates highlightjs version
  fixes deprecated Github favicons #1300
  Apply fixes from StyleCI (#1303)
  Corrected bug when CANVAS_PATH is empty in EmbedImageModal and FeaturedImageModal
austintoddj added a commit that referenced this issue Jun 22, 2023
v6.0.47 stable release

* tag 'v6.0.47':
  builds assets
  Apply fixes from StyleCI (#1304)
  adds laravel mix and node scripts to fix #1181
  uses an svg instead of an icon #1300
  updates dependencies and compiles assets
  updates highlightjs version
  fixes deprecated Github favicons #1300
  Apply fixes from StyleCI (#1303)
  Corrected bug when CANVAS_PATH is empty in EmbedImageModal and FeaturedImageModal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants