Skip to content

Commit

Permalink
fix: Add error handling for missing dependencies (fixes #1210) (#1232)
Browse files Browse the repository at this point in the history
* Add error handling for missing dependencies

* Informative error message

* Add error handling for missing dependencies

* Informative error message

* Add dependecy import location, error message changes
  • Loading branch information
mohammedsahl authored Jun 23, 2020
1 parent 4b02177 commit 3673001
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,17 @@ async function build(opts) {
__VERSION__: version,
'process.env.SSR': false
})
])
]),
onwarn: function (message) {
if (message.code === 'UNRESOLVED_IMPORT') {
throw new Error(
`Could not resolve module ` +
message.source +
`. Try running 'npm install' or using rollup's 'external' option if this is an external dependency. ` +
`Module ${message.source} is imported in ${message.importer}`
)
}
}
})
.then(function (bundle) {
var dest = 'lib/' + (opts.output || opts.input)
Expand Down

1 comment on commit 3673001

@vercel
Copy link

@vercel vercel bot commented on 3673001 Jun 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.