Skip to content

Parse JS SDK and RequireJS or Webpack #421

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

Closed
camdagr8 opened this issue Apr 5, 2017 · 7 comments
Closed

Parse JS SDK and RequireJS or Webpack #421

camdagr8 opened this issue Apr 5, 2017 · 7 comments

Comments

@camdagr8
Copy link

camdagr8 commented Apr 5, 2017

I'm trying to include the Parse Javascript SDK (1.9.2) via npm (https://www.npmjs.com/package/parse) and I keep getting the following error in the browser:

Uncaught ReferenceError: require is not defined
    at Object.<anonymous> (external "events":1)
    at __webpack_require__ (bootstrap 8ca8db8…:19)
    at Object.root (EventEmitter.js:14)
    at __webpack_require__ (bootstrap 8ca8db8…:19)
    at Object.defineProperty.value (ParseLiveQuery.js:7)
    at __webpack_require__ (bootstrap 8ca8db8…:19)
    at Object.defineProperty.value (Parse.js:152)
    at __webpack_require__ (bootstrap 8ca8db8…:19)
    at Object.defineProperty.value (index.js:1)
    at __webpack_require__ (bootstrap 8ca8db8…:19)

Things I've Looked at:

So..

Can someone point me in the right direction as to what could be causing this error?

Thanks!

@camdagr8
Copy link
Author

camdagr8 commented Apr 5, 2017

Maybe the same thing as these issues:
#238
#244

@ChrisGrant
Copy link

@camdagr8 I'm having the exact same issue. Did you manage to fix this or work around it somehow?

@camdagr8
Copy link
Author

Sort of. I just included it the old fashioned way into my <head> tag

@Etto91
Copy link

Etto91 commented Nov 4, 2017

same problem solved by importing the version on dist folder it's ok?

import Parse from '../../node_modules/parse/dist/parse.min';

@cleever
Copy link

cleever commented Nov 4, 2017

I use it by importing from the dist folder as well:

import Parse from 'parse/dist/parse.js';

@camdagr8
Copy link
Author

camdagr8 commented Nov 9, 2017

@cleever your method works for me. Thanks!

@stale
Copy link

stale bot commented Feb 6, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

5 participants