Open olucasandrade opened 1 year ago
AdminJS needs node_modules
in runtime.
ADMIN_JS_SKIP_BUNDLE="true"
should skip runtime bundling if used with NODE_ENV=production
, but AdminJS still needs access to node_modules
to get app.bundle.js
, design-system.bundle.js
and global.bundle.js
. Your entry file is theoretically correct but the error implies that the bundling started in the runtime though. It's best to check what's inside of generated components.bundle.js
.
@dziraf, sir I didn't understand your answer, could you please be more specific?
Im getting
file:///C:/Users/Hecto/OneDrive/Documentos/GitHub/test/node_modules/adminjs/lib/backend/utils/component-loader.js:80
throw new ConfigurationError(Trying to bundle file '${src}' but it doesn't exist
, 'AdminJS.html');
This is how my componentLoader looks like
import { ComponentLoader } from "adminjs"; const componentLoader = new ComponentLoader(); const Components = { Dashboard: componentLoader.add("dashboard", "./dashboard"), };
export { Components, componentLoader };
I have been working on the problem, I'm working with TS. Now its kind of working but on the .entry.js its creating the files path with many //..//..//, is thast correct?
AdminJS.UserComponents = {} import dashboard from '../../../../../../../../C:/Users/Hecto/OneDrive/Documentos/GitHub/test/src/components/dashboard.jsx' AdminJS.UserComponents.dashboard = dashboard
Here the same issue.. Someone know how to fix it?
I'm not using TS.. just JS
UPDATE:
I'm on Windows.
In my case I notice that in the component-loader.js on row 72 have:
if (fs.existsSync(fileName)) {
This line always return false even when the path is correct. My solution was pass the absolute file path instead the relative.
import { ComponentLoader } from 'adminjs';
import path from 'path';
const componentLoader = new ComponentLoader();
let absolute = path.resolve('./app/components/my_input.jsx');
const Components = {
MyInput: componentLoader.add('MyInput', absolute),
}
export { componentLoader, Components };
I had the same issue with v7 on Windows - no issue in *nix machines Solution https://github.com/SoftwareBrothers/adminjs/issues/1185#issuecomment-1676308332
I have an api with adminjs and upload feature with aws s3 that is working correctly when i run locally. But when deployed on vercel i get the following error:
Installed libraries and their versions
Setup
my entry file generated automatically
Obs: I already tried to use @adminjs/bundler with
ADMIN_JS_SKIP_BUNDLE="true"
, but i'm not sure if i'm doing it correctly.And my project an only .js app.