Skip to content

Commit

Permalink
Add browser entry to package.json, see #995
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Mar 7, 2018
1 parent 918ff01 commit 7c391d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "protobufjs",
"version": "6.8.6",
"version": "6.8.7",
"versionScheme": "~",
"description": "Protocol Buffers for JavaScript (& TypeScript).",
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
Expand All @@ -18,6 +18,7 @@
"typescript"
],
"main": "index.js",
"browser": "dist/protobuf.js",
"types": "index.d.ts",
"bin": {
"pbjs": "bin/pbjs",
Expand Down

1 comment on commit 7c391d6

@SlyryD
Copy link
Contributor

@SlyryD SlyryD commented on 7c391d6 May 18, 2018

Choose a reason for hiding this comment

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

Adding the line
"browser": "dist/protobuf.js",
causes issues when we use browserify to create our own bundle that has protobufjs as a dependency.

Example error:
Error: Cannot find module '5' from 'C:\Users\rydorson\AugmentationLoop\node_modules\protobufjs\dist' at C:\Users\rydorson\AugmentationLoop\node_modules\browser-resolve\node_modules\resolve\lib\async.js:46:17 at process (C:\Users\rydorson\AugmentationLoop\node_modules\browser-resolve\node_modules\resolve\lib\async.js:173:43) at ondir (C:\Users\rydorson\AugmentationLoop\node_modules\browser-resolve\node_modules\resolve\lib\async.js:188:17) at load (C:\Users\rydorson\AugmentationLoop\node_modules\browser-resolve\node_modules\resolve\lib\async.js:69:43) at onex (C:\Users\rydorson\AugmentationLoop\node_modules\browser-resolve\node_modules\resolve\lib\async.js:92:31) at C:\Users\rydorson\AugmentationLoop\node_modules\browser-resolve\node_modules\resolve\lib\async.js:22:47

Please sign in to comment.