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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:53:33+00:00 2026-05-20T15:53:33+00:00

Is anyone familiar with Yabble or other browser-side CommonJS loaders? I’m experimenting with Node.js

  • 0

Is anyone familiar with Yabble or other browser-side CommonJS loaders?

I’m experimenting with Node.js and would very much like to create Javascript modules which can be used interchangeably on the server side and the client side. This may end up being more a “because it’s awesome” kind of thing more so than “because it’s practical and useful” kind of thing.

As such, I’m basically trying to get the CommonJS require() method to work on the browser-side, which is exactly what Yabble is supposed to do. I don’t really know where to start with it though. I can’t seem to find any documentation other than what’s found in Yabble’s Github readme, and that’s not helping much.

Essentially all I’ve done is put this in an HTML page…

<script src="yabble.js"></script>

<!-- Uses require -->
<script>
    require.setModuleRoot('http://localhost:8030/')
    my_module = require('my_module')
</script>

But anytime I call the require() function all I get a Synchronous require() is not supported. exception thrown.

Can someone help me get started? Where am I supposed to load yabble.js where am I supposed to call require? Is there a special way to run my Javascript modules?

  • 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-05-20T15:53:34+00:00Added an answer on May 20, 2026 at 3:53 pm

    When loading Javascript code that will need to use the require() function into the browser, the entry point into that code must be the require.run() function.

    e.g., Good:

    <script src="yabble.js"></script>
    
    <script>
        require.setModuleRoot('http://localhost:8030/')
        require.run('my_module') // <-- Uses require() function somewhere
    </script>
    

    e.g., Bad (Will get the Synchronous require() is not supported error):

    <script src="yabble.js"></script>
    <script src="http://localhost:8030/my_module.js"></script> <!-- <== Use's require function somewhere -->
    

    FYI, it’s pretty nifty how Yabble does this. It will actually statically analyze your Javascript source code, I think basically just using a regular expression to look for the require() method, and then try to pull that .js script from the server, then it does the same static analysis of that .js script, and on and on.

    This can be particularly confusing because it will actually load those .js scripts even if the control logic would mean program flow would never reach the require() function. e.g., if you had…

    if (False) { require('some_module'); }
    

    … Yabble will still load this module.

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

Sidebar

Related Questions

Anyone who writes client-side JavaScript is familiar with the DOM - the tree structure
Like almost anyone who's been programming for a while, I'm familiar with the term
Is anyone familiar with this term? Can't find much about it on the interwebs.
Anyone familiar with specific security issues in the current version of DotNetNuke? (I've already
Anyone familiar with error below? When I run my webapp to generate a dynamic
Is anyone familiar with a tool that generates code stubs with meaningful names from
Question: Is anyone out there familiar enough with Komodo Edit to shed some light
Anyone familiar with a way how can I can i write something to the
Anyone familiar with the differences in starting with Webstart(javaws.exe) compared to starting the app.
Is anyone familiar with Native Code in OS X Safari (Version 3 and WebKit)?

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.