question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm version seems to compiled incorrectly (or: missing dependencies)

See original GitHub issue

Hello there,

I tried using npm version of bootstrap-sweetalert (1.0.1), but when I require() it I get the following:

Error: Cannot find module './handle-dom' from '/tmp/node_modules/bootstrap-sweetalert/dist'
    at /tmp/node_modules/browserify/node_modules/resolve/lib/async.js:55:21
    at load (/tmp/node_modules/browserify/node_modules/resolve/lib/async.js:69:43)
    at onex (/tmp/node_modules/browserify/node_modules/resolve/lib/async.js:92:31)
    at /tmp/node_modules/browserify/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:82:15)

On the other hand, if I go with “vanilla” sweetalert, I get no such issue.

Any ideas?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
alekittocommented, Dec 20, 2016

I don’t think you can simply require the compiled dist file. Have you tried to import (ES6 style) the dev/sweetalert.es6.js file?

0reactions
pwqwcommented, Mar 12, 2017

I tried to import {SweetAlert} from "bootstrap-sweetalert/dev/sweetalert.es6" and got the following error:

[16:18:28] gulp-notify: [Compile Error] SyntaxError: Unexpected token (9:7) while parsing [PROJECT_DIR]/node_modules/bootstrap-sweetalert/dev/sweetalert.es6.js while parsing file: [PROJECT_DIR]/node_modules/bootstrap-sweetalert/dev/sweetalert.es6.js

The es6 file contains:

// [...]
import {
  hasClass, addClass, removeClass,    // and this is the line 9: column 7
  escapeHtml,
  _show, show, _hide, hide,
  isDescendant,
  getTopMargin,
  fadeIn, fadeOut,
  fireClick,
  stopEventPropagation
} from './modules/handle-dom';
// [...]

I’m using browserify and babel

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does npm install say I have unmet dependencies?
The problem could be caused by npm's failure to download all the package due to timed-out or something else. Note: You can also...
Read more >
Missing dependencies after running `npm install` a second ...
I'm opening this issue because: npm is crashing. npm is producing an incorrect install. npm is doing something I don't understand.
Read more >
Troubleshooting Node.js Deploys
Make sure a Node version is specified. Heroku will output which binaries (ie. node , npm ) are used for each deploy in...
Read more >
npm, pnpm, and Yarn | IntelliJ IDEA Documentation
Install all dependencies listed in a package.json file ... In the embedded Terminal ( Alt+F12 ) , type one of the following commands:...
Read more >
Error Codes | Yarn - Package Manager
The author of packageA can fix this problem by adding a peer dependency on packagePeer . If relevant, they can use optional peer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found