#The error I received after running the 'php artisan inertia:start-ssr' command.

1 messages · Page 1 of 1 (latest)

plush sun
#

First off all, please use English.

onyx nimbus
#

oh sorry.

#

edited.

plush sun
#

The error is telling you tinymce doesn't exist, probably because you're calling it on the window. Within SSR there is no window object, since there is no browser, just Node. Since you're using Vue I'd recommend to follow their steps; https://www.tiny.cloud/docs/tinymce/latest/vue-pm/. That way you'll import the package instead of relying on global window variables

onyx nimbus
#

thank u.

onyx nimbus
#

Now I have a new error message.

php artisan inertia:start-ssr   

file:///Applications/XAMPP/xamppfiles/htdocs/W/INERTIA/bootstrap/ssr/ssr.js:10719
})(jQuery, window);
   ^

ReferenceError: jQuery is not defined
    at file:///Applications/XAMPP/xamppfiles/htdocs/W/INERTIA/bootstrap/ssr/ssr.js:10719:4
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:120:12)

Node.js v21.6.2

plush sun
#

It's the same thing, but then for jquery.

onyx nimbus
#

I can't seem to find how to define jQuery.

plush sun
onyx nimbus
#

I've already done this process; I installed jQuery via npm. But how should I import it? Should I import it into the app.js file or the ssr.js file?

plush sun
#

You'd import it where you're using it.

onyx nimbus
#

import jQuery from 'jquery';
window.$ = jQuery;

I added it to all .vue files where I use Footable as mentioned above, but nothing changed.

plush sun
#

Yes, because in SSR the window doesn't exist

onyx nimbus
#

So, how should I do it? If I can't do this, I'll have to remove Footable from approximately 300 .vue files.

plush sun
#

You'd need to add those imports to the Vue files so they won't be called on the window

onyx nimbus
#

<script>
import Pagination from "../../../Shared/Pagination.vue";
import ValidateError from "../../../Components/ValidateError.vue";
import * as Footable from '../../../Scripts/libs/footable/footable.all.min.js'
import * as Footableinit from '../../../Scripts/js/pages/foo-tables.init.js'
import jQuery from 'jquery';
window.$ = jQuery;

I'm using it like this. When I compile with SSR, I get an error.

plush sun
#

As I said now multiple times, you'd need to import it on all places you use it, don't use window, don't set it on the window

onyx nimbus
#

All right, should I just use 'import jQuery from 'jquery';'? Can you give me an example?

onyx nimbus
#
[Vue warn]: Property "route" was accessed during render but is not defined on instance.
TypeError: _ctx.route is not a function
    at file:///Applications/XAMPP/xamppfiles/htdocs/W/INERTIA/bootstrap/ssr/ssr.js:312:20

H, Robert. Now I'm getting a completely different error, and when I visit the site, I see the network details as shown in the attached screenshot.

onyx nimbus
#

Are u there?

onyx nimbus
#

@plush sun