Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r js stops loading dependecies of module when i use specific module name for that file. #1001

Open
sohankd opened this issue Oct 21, 2019 · 1 comment

Comments

@sohankd
Copy link

sohankd commented Oct 21, 2019

When i assign different module name's to files, both r.js and requirejs stops loading the dependcies even if the dependecies are assigned with relative url instead of their module name.

The below code thows an error like 'Application is not a constructor' when add the application module as a depency in require call with its name and run it locally.

var app = require('Application');
console.log(new app()); //throws Error: Application is not a constructor.

Application.js

`define('Application',
[
'../../Layout/JavaScript/Layout.View'
, '../../../starter'
, 'backbone'
, 'Marionette'
]
, function
(
Layout
, starter
, Backbone
, Marionette
)
{
'use strict';

return Marionette.Application.extend({});`
  1. When i hit this command 'r.js -o build.js' in cmd prompt, it stops loading modules after application module.
@prantlf
Copy link

prantlf commented Apr 23, 2023

I had bad experience with including the same module by different paths. I assigned the path roots aliases using paths in require.config like lib: '../vendors'. I included the modules always by the same names (paths) starting with the alias prefixes like lib/backbone and lib/marionette.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants