Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught SyntaxError: The requested module './npm_deps.js' does not provide an export named 'npmDeps' #2

Closed
waynedyck opened this issue Jul 7, 2023 · 1 comment

Comments

@waynedyck
Copy link

I'm attempting to update this project to use the latest version of ClojureScript and React, however, I have encountered an error I am having difficulty figuring out.

On my first execution of lein figwheel I encounter the following error in the console,

Uncaught SyntaxError: Cannot use import statement outside a module

So, in the /public/index.html file I changed the script type= to module from text/javascript which gets ride of the import statement error, however, the console then shows the error message about the missing export named 'npmDeps'.

The first line of my /js/app.js has the following inserted,

import {npmDeps} from "./npm_deps.js";

The contents of the npm_deps.js file are,

module.exports = {
  npmDeps: {
    "react-dom": require('react-dom'),
    "react": require('react')  }
};

Both the npm_deps.js and app.js files are in the same directory.

Do you have any suggestions or insight into what the issue would be?

@waynedyck
Copy link
Author

Project now builds and runs without errors with pull request #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant