You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.
The project is set up to use the assets pipeline for some files, and RequireJS is setup separately to handle modules. In the dev environment, when the assets are not precompiled, everything works just fine.
Unfortunately in staging and production the modules won't work anymore.
After rake assets:precompile I can see all the modules precompiled, ready to go, and loaded in the browser when I hit the page, but non of the juice the module should do works.
Below I included the code I am using to access my module:
I think this may be a problem related to changes in RequireJS 2.x. See Upgrading to RequireJS 2.0, especially:
So RequireJS 2.0 will not execute the module's factory function (the function passed to define()), until there has been a require([]) call that has asked for it, or something that depends on it. The use of data-main on the require.js script tag counts as a require([]) call, so most best-practices use of require.js should not notice a difference.
IIRC, you can try changing the top-level page define calls to require calls and see if that works. Apologies for the delayed response; I've been very heads-down on work issues followed by some travel with virtually no 'net access. If that doesn't work, give a holler on the requirejs group to see if anyone there has suggestions for you.
I am having an annoying issue Rails 3.2.3.
The project is set up to use the assets pipeline for some files, and RequireJS is setup separately to handle modules. In the dev environment, when the assets are not precompiled, everything works just fine.
Unfortunately in staging and production the modules won't work anymore.
After
rake assets:precompile
I can see all the modules precompiled, ready to go, and loaded in the browser when I hit the page, but non of the juice the module should do works.Below I included the code I am using to access my module:
The generated RequireJS source:
The contents of page1.js file:
After hitting the page the console output looks like this:
There is no errors in the console whatsoever.
Any help would be much appreciated!
The text was updated successfully, but these errors were encountered: