Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8440223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:13:54+00:00 2026-06-10T08:13:54+00:00

I am having a problem where almost-identical require.js config calls appear to work differently,

  • 0

I am having a problem where almost-identical require.js config calls appear to work differently, in one case failing to set baseUrl and path.

Folder structure

 - /js
 - - app/
 - - libs/
 - - - hogan.js
 - - - backbone
 - - - - backbone.js
 - - - - etc.
 - - - boostrap
 - - - jquery
 - - - - jquery.js
 - - - - etc.
 - - - require
 - - - - require.js
 - - - - etc.
 - - templates/
 - - require.config.js

Script tag

<script data-main="/resources/js/require.config" src="/resources/js/libs/require/require.js"></script>

Require configuration

require.config(
    {
        baseUrl: "/resources/js/libs",
        shim: {
            "underscore": {
                exports: "_"
            },
            "backbone": {
                deps: [
                    "json2",
                    "underscore",
                    "jquery"
                ],
                exports: "Backbone"
            }
        },
        paths: {
            "app": "/resources/js/app",
            "backbone": "backbone/backbone",
            "jquery": "jquery/jquery",
            "templates": "/resources/js/templates",
            "templateEngine": "hogan"
        }
    }
);

require(
    [
        "app/router"
    ],
    function( AppRouter ){
        AppRouter.execute();
    } 
);

In both cases, a script tag gets appended that shows the full contents of require.config.js, starting with:

<script type="text/javascript" charset="utf-8" data-requirecontext="_" data-requiremodule="require.config" src="/resources/js/require.config.js">

Definition in app/router

define(
    [
        'backbone',
        'templateEngine'
    ],
// etc
);

However where the problem occurs, app/router is never loaded, only the following (no 404, nothing):

GET require.js 200 OK 180ms     
GET require.config.js 200 OK 69ms

If I enter require(["app/router"]); into the Firebug console I get the following:

"NetworkError: 404 Not Found - /resources/js/backbone.js
"NetworkError: 404 Not Found - /resources/js/templateEngine.js"

When what I expect to see is:

  • /resources/js/libs/backbone/backbone.js
  • /resources/js/libs/hogan.js

Solutions attempted

  • I have attempted to use various combinations of relative and absolute paths for baseUrl and paths. For example baseUrl: libs, and paths: { "app" : "../app" }, etc.
  • I tried deps and callback instead of using require below config.
  • I have added the property context, matching baseUrl.
  • I have moved require.config.js into the libs directory (editing baseUrl and paths as appropriate; still get the same issue of ignored config, only it tries to load /resources/js/libs/backbone.js instead, for example).

Note

This folder structure and config file does work on my localhost, where I remove /resources/ from the paths as shown above. Instead all-relative paths (none starting with /) are used for baseUrl and paths. But on the actual server that is not an option.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:13:55+00:00Added an answer on June 10, 2026 at 8:13 am

    Solution was to not have any . (periods) in the configuration file’s filename. After renaming the file to require-config.js everything worked as expected. Other files are fine with dots in the name, just not the main configuration file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having a problem with my 301 not being detected in my file, almost
I'm having a problem with what almost seems like a bug in iOS. I'm
I'm having a problem getting TryParse to work correctly for me. I have a
I'm having a problem with my PHP pagination for a project. It almost works
I'm having a problem getting this functionality to work. Situation is: User Drags an
I'm having some problems building an hierarchistic array structure - I have almost got
Having problem with the middle Div not expanding to the width http://acs.graphicsmayhem.com/images/middiv.jpg Ok, how
Im having problem in my UIscrollView ,this is what I have done: Whenever a
I am having problem using mvc:resources in spring 3.1 configuration. Initially i was working
I am having problem with previewing custom performance counters with PerflibV2. Performance Monitor shows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.