#The error I received after running the 'php artisan inertia:start-ssr' command.
1 messages · Page 1 of 1 (latest)
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
thank u.
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
It's the same thing, but then for jquery.
I can't seem to find how to define jQuery.
It's the same error, but then a different package; https://www.npmjs.com/package/jquery
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?
You'd import it where you're using it.
import jQuery from 'jquery';
window.$ = jQuery;
I added it to all .vue files where I use Footable as mentioned above, but nothing changed.
Yes, because in SSR the window doesn't exist
So, how should I do it? If I can't do this, I'll have to remove Footable from approximately 300 .vue files.
You'd need to add those imports to the Vue files so they won't be called on the window
<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.
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
All right, should I just use 'import jQuery from 'jquery';'? Can you give me an example?
[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.
Are u there?
@plush sun