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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:19:52+00:00 2026-06-03T03:19:52+00:00

In order to share AMD modules between the browser and node, I’m using RequireJS

  • 0

In order to share AMD modules between the browser and node, I’m using RequireJS in both places (see RequireJS in Node).

server/dataDao.js:

var requirejs = require('requirejs');
var dataDao = module.exports = {};

requirejs(['client/resource'], function (Resource) {
   ...
});

client/resource.js:

define(['underscore'], function (_) {
  ...
});

This has generally been working ok, as long as the shared module does not involve any dependencies that don’t work on the server.

I would like to introduce use.js, however, to avoid manually wrapping non-AMD compatible libs like underscore. To do so, I have to prefix listed dependencies with use! (to trigger the use plugin in RequireJS).

client/resource.js:

define(['use!underscore'], function (_) {
  ...
});

This works well in the browser, but causes errors in Node:

Error: Calling node's require("use") failed with error: Error: Cannot find module 'use'

I believe this is not specific to the use plugin, but also text etc.

Has anyone else encountered this problem?

  • 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-03T03:19:54+00:00Added an answer on June 3, 2026 at 3:19 am

    With version 0.3 of use I was able to get it working in node. Per the comment on your question, it may be a configuration issue — it took me a couple of tries to get the pathing right.

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

Sidebar

Related Questions

I am using a Kubuntu image using VMWare. In order to share files between
I am using KTPhotoBrowser in order to display images parsed from a server. Also,
I have created an HttpCookie in order to share data across a subdomain :
How do guys suggest to share a constants file between PHP and JavaScript, in
I am trying to share a common namespace between two projects in a single
i'm trying to login to facebook in order to share a link through facebook
I've read that I should store an ObjectContext in HttpContext.Current in order to share
We are using Microsoft reporting services in order to generate reports for our customers.
I am trying to figure out an elegant way to share a variable between
I'm a student and recently I'm making a website in order to share the

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.