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

Using handlebars as ES6 module on the browser #1707

Closed
4 tasks done
camilonova opened this issue Aug 11, 2020 · 3 comments
Closed
4 tasks done

Using handlebars as ES6 module on the browser #1707

camilonova opened this issue Aug 11, 2020 · 3 comments

Comments

@camilonova
Copy link

Before filing issues, please check the following points first:

This will probably help you to get a solution faster.
For bugs, it would be great to have a PR with a failing test-case.

Hi. I'm trying to do this:

import '../node_modules/jquery/dist/jquery.min.js';
import '../node_modules/jquery-validation/dist/jquery.validate.min.js';
import '../node_modules/jquery-validation/dist/additional-methods.min.js';
import '../node_modules/handlebars/dist/handlebars.runtime.js';

console.log(Handlebars.VERSION);

Is throwing this error:

handlebars.runtime.js:35 Uncaught TypeError: Cannot set property 'Handlebars' of undefined
    at webpackUniversalModuleDefinition (handlebars.runtime.js:35)
    at handlebars.runtime.js:36

I'm not using webpack, just trying to use native ES6 modules at the browser.

@camilonova
Copy link
Author

I ended up using webpack

@softmarshmallow
Copy link

Doesn't work on webpack either. (for me)

Cannot read property 'Handlebars'

@capaj
Copy link

capaj commented May 4, 2024

@camilonova handlebars don't work in webpack too. See #953

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

3 participants