Closed marcelodelta closed 11 months ago
Has anyone experienced this problem?
Yes, I have the same issue
@ralphdas Did I get it resolved?
Short answer, No. Although i'm in a React environment I'am struggling with the same issue. I currently do not have the time to really dive into it. I think these issues might also be resolved sort when Adonis v.6 launches since it's ES modules based opposed to CommonJS.
I believe it will still take a while for version 6. And I need to use it with the ssr function. I've tried everything in my power. I can't solve this transpiler.
@ralphdas
I managed to resolve.
Must be capitalized App
setup({ App, props, plugin }) { return createSSRApp({ render: () => h(App, props), }).use(plugin); },
follow the video
https://www.youtube.com/watch?v=Npn-2qweD5k
I did all the step by step to run an ssr application, but without success.
config/inertia
resources/js/ssr.js
webpack.ssr.config
run the commands
node ace serve --watch node ace ssr:watch
require() of ES Module C:\Users\Projeto\node_modules\@inertiajs\vue3\dist\index.js from C:\Users\Projeto\inertia\ssr\ssr.js not supported. index.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules. Instead rename index.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in C:\Users\Projeto\node_modules\@inertiajs\vue3\package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).