0

I tried to deploy symfony app using :

symfony cloud:deploy

But I got this erro:

Module build failed: Module not found:
"./assets/bootstrap.js" contains a reference to the file "./controllers".
This file can not be found, please check it for typos or update it if the file got moved.

The push completed but there was a deployment error ("Error building project").
// ./assets/bootstrap.js

import { startStimulusApp } from '@symfony/stimulus-bridge';

// Registers Stimulus controllers from controllers.json and in the controllers/ directory
export const app = startStimulusApp(require.context(
    '@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
    true,
    /\.[jt]sx?$/
));

// register any custom, 3rd party controllers here
// app.register('some_controller_name', SomeImportedController);

On a local server it works fine and i tried everything explained here : https://symfony.com/doc/current/deployment.html

I commented out all of the bootstrap.js file and the deployment worked, but i really need its features.

2
  • given you mention that it works locally, are you sure assets/controllers/ have been git add'ed commit'ed before pushing? Commented Jan 29, 2024 at 17:35
  • and this problem looks similar to what you're encountering stackoverflow.com/questions/77684268/… Commented Jan 29, 2024 at 17:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.