Skip to content

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

Open

Description

@sohankd

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.

Activity

  1. prantlf commented on Apr 23, 2023

    @prantlf

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions