Closed yoeriboven closed 1 year ago
Right after posting this it suddenly worked.
The same error message persists though.
It's thrown at the top of my app.js
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./lang lazy recursive ^\\.\\/.*\\.json$":
/*!****************************************************!*\
!*** ./lang/ lazy ^\.\/.*\.json$ namespace object ***!
\****************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var map = {
"./php_en.json": [
"./lang/php_en.json",
"lang_php_en_json"
],
"./php_nl.json": [
"./lang/php_nl.json",
"lang_php_nl_json"
]
};
function webpackAsyncContext(req) {
if(!__webpack_require__.o(map, req)) {
return Promise.resolve().then(() => {
var e = new Error("Cannot find module '" + req + "'");
e.code = 'MODULE_NOT_FOUND';
throw e;
});
}
var ids = map[req], id = ids[0];
return __webpack_require__.e(ids[1]).then(() => {
return __webpack_require__.t(id, 3 | 16);
});
}
webpackAsyncContext.keys = () => (Object.keys(map));
webpackAsyncContext.id = "./lang lazy recursive ^\\.\\/.*\\.json$";
module.exports = webpackAsyncContext;
If possible can you provide your app.js
file, to try to debug here?
Thanks.
import {createApp, h} from 'vue';
import {createInertiaApp, Link} from '@inertiajs/inertia-vue3';
import {InertiaProgress} from '@inertiajs/progress';
import {i18nVue} from 'laravel-vue-i18n'
import {ZiggyVue} from '../../vendor/tightenco/ziggy/dist/vue.m';
import {modal} from "momentum-modal"
const appName = window.document.getElementsByTagName('title')[0]?.innerText || 'Appname';
createInertiaApp({
title: (title) => `${title} - ${appName}`,
resolve: (name) => require(`./Pages/${name}.vue`),
setup({ el, app, props, plugin }) {
return createApp({ render: () => h(app, props) })
.use(plugin)
.use(modal, {
resolve: (name) => require(`./Pages/${name}.vue`),
})
.use(ZiggyVue, Ziggy)
.use(i18nVue, {
resolve: lang => import(`../../lang/${lang}.json`),
})
.component('Link', Link)
.mount(el);
},
});
InertiaProgress.init({ color: '#4B5563' });
I have the same problem: Uncaught (in promise) Error: Cannot find module './en.json'
// app.js
import './bootstrap'; import { createApp } from 'vue' import { i18nVue } from 'laravel-vue-i18n' import DataList from './components/Table.vue'
const app = createApp({}) app.component('data-list', DataList)
app.use(i18nVue, {
resolve: lang => import(../../lang/${lang}.json
),
})
app.mount('#app')
// webpack.mix.js const mix = require('laravel-mix'); require('laravel-vue-i18n/mix');
mix.js('resources/js/app.js', 'public/js') .vue() .i18n() .postCss('resources/css/app.css', 'public/css', [ // ]);
Hey @yoeriboven its possible for you to create a public repo, with that issue?
Trying to replicate without luck.
Thanks
closed? this bug is still there
@fheider Hi, if you still got this issue please do what Francisco asked in the comment above. I don't work on a project that has this issue anymore.
its an error in the loader file, cause there you name the file
line 58 return { name: 'php_${folder}.json', translations }
if i change this, all is fine. i solved it for me with an empty en.json file cause i dont need the php translations.
Can you create a repo for me with that exact problem?
Thanks.
Hi Francisco,
I can't get the package to work with PHP files.
I followed these steps (no SSR): https://github.com/xiCO2k/laravel-vue-i18n#with-webpack--laravel-mix
The console says this:
Unhandled Promise Rejection: Error: Cannot find module './en.json'
.The file
/public/js/lang_php_en_json.js
exists.Also is resolving as instructed in app.js correct? The file
../../lang/${lang}.json
does not exist. In../../lang/en/
are my PHP translation files. No json file.Any idea what to do?