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 8646725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:53:15+00:00 2026-06-12T12:53:15+00:00

I am using RequireJS 2.0.6. And sometimes I have a laoding issue with one

  • 0

I am using RequireJS 2.0.6. And sometimes I have a laoding issue with one of my library (amplifyjs).

Project:

libs/
    amplify.js
    handlebars.js
    jquery.js
    require.js
packages/
    core/
        main.js
index.html
main.js

My main.js:

require.config({
    paths: {
        'jquery': '../libs/jquery',
        'amplify': '../libs/amplify',
        'handlebars': '../libs/handlebars'
    },
    shim: {
        'jquery': {
            exports: '$'
        },
        'amplify': {
            deps: ['jquery'],
            exports: 'amplify'
        },
        'handlebars': {
            exports: 'handlebars'
        }
    },
    packages: ['core'],
    baseUrl: './packages/'
});

require(['jquery', 'amplify', 'handlebars', 'core'], function() {
});

Index.html:

<script type="text/javascript" data-main="main" src="libs/require.js"></script>

75% of time it works but sometimes I get this error:

GET http://localhost:8888/aa/test/packages/libs/amplify.js 404 (Not Found) 
Uncaught Error: Script error
    http://requirejs.org/docs/errors.html#scripterror 

The path is wrong! But I cannot figure out why this happens ? And why only sometimes ?

(I am pretty sure it has to do something with the package, but I have no idea why it does that)

  • 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-12T12:53:17+00:00Added an answer on June 12, 2026 at 12:53 pm

    I figured out another way to do it and it works!

    require.config({
        paths: {
            libs: '../libs'
        },
        packages: ['core'],
        shim: {
            'libs/amplify': {
                deps: ['libs/jquery'],
                exports: 'amplify'
            },
            'libs/handlebars': {
                deps: ['libs/jquery'],
                exports: 'handlebars'
            },
            'core': {
                deps: ['libs/amplify', 'libs/handlebars']
            }
    
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web app built with Dojo 1.7.2, using RequireJS to load individual
Using Require.js and it works pretty solid. However, I'm reading about optimization (http://requirejs.org/docs/optimization.html) using
I've been messing around with a backbone.js app using require.js and a handlebars templates
I have recently just created Java project using Eclipse that requires 2 JAR files
I want to describe an issue I have been having with Plot using With
I have written a simplified Silverlight client library for my WCF web service using
I'm using requireJS & Jquery Mobile. I some areas off my app I'm doing
I'm using requireJS to load scripts. It has this detail in the docs :
So I am making a test app using RequireJs, Mustache and Backbone.js. I had
I am in the following situation. I am using requireJs to loads module and

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.