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

Broken bundle #89

Open
linegel opened this issue Oct 17, 2018 · 2 comments
Open

Broken bundle #89

linegel opened this issue Oct 17, 2018 · 2 comments
Labels

Comments

@linegel
Copy link

linegel commented Oct 17, 2018

Bundling with these settings make react-native app crash with errors about how ostrio:files and eventemiiter (their dependency) built. After researching in it, i found very strange break in generated bundle.

It looks in this way:

"node_modules": { "eventemitter3": { "package.json": function (_require7, _exports7, _module6) {

                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //                                                                                                                    //
                // node_modules/meteor/ostrio_files/node_modules/eventemitter3/package.json                                           //
                //                                                                                                                    //
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //
                _module6.exports = {
                  "name": "eventemitter3",
                  "version":

                  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                  //                                                                                                                    //
                  // packages/ostrio_files/upload.js                                                                                    //
                  //                                                                                                                    //
                  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                  //
                      _module5.export({
                          FileUpload: () => FileUpload,
                          UploadInstance: () => UploadInstance
                      });
                              let HTTP;
                              _module5.link("meteor/http", {
                                  HTTP(v) {
                                      HTTP = v;
                                  }

                              }, 0);
                              let Meteor;
                              _module5.link("meteor/meteor", {
                                  Meteor(v) {
                                      Meteor = v;

As you can see, description of module6 of eventemitter interrupted for some reasons with declaration of module5 (which was previously declared). I can attach full builded bundle, if you think it can help to find a problem. Or even if you will give some advice about path which I should follow to resolve problem also will be very helpful. Thank you anyway

As last word, bundler.config.json

{
  "release": "1.8",
  "runtime": {
    "DDP_DEFAULT_CONNECTION_URL": "localhost:3000"
  },
  "import": [
    "mongo",
    "minimongo",
    "meteor-base",
    "accounts-base",
    "accounts-password",
    "react-meteor-data",
    "ostrio:files"
  ],
  "npmPackages": [
    "react",
    "simpl-schema@1.5.0"
  ]
}
@ardatan ardatan added the bug label Oct 17, 2018
@ardatan
Copy link
Collaborator

ardatan commented Oct 17, 2018

You can add two fields, and install dependencies in externalNpmPackages field seperately in your project. I can suggest this for workaround. Let me if it works or fails.

{
  "release": "1.8",
  "runtime": {
    "DDP_DEFAULT_CONNECTION_URL": "159.100.251.65:3000"
  },
  "import": [
    "mongo",
    "minimongo",
    "meteor-base",
    "accounts-base",
    "accounts-password",
    "react-meteor-data",
    "ostrio:files"
  ],
  "externalNpmPackages": [
      "@babel/runtime",
      "core-js",
      "meteor-node-stubs",
      "react",
      "simpl-schema@1.5.0",
      "eventemitter3"
  ],
  "generateNodeModules": true,
  "npmInstall": false
}

@Deadly0
Copy link

Deadly0 commented Mar 11, 2019

@ardatan i've got similar issue but with React in meteor 1.8. In the bundle i've got the code:

            let React;
            _module2.link("react", {
              default(v) {
                React = v;
              }

and error Uncaught Error: Cannot find module 'react' referring to the code above

My config is

{
  "import": [
    "meteor-base",
    "mongo",
    "tracker",
    "accounts-password",
    "alanning:roles",
    "underscore",
    "mrt:external-file-loader",
    "react-meteor-data",
    "jagi:astronomy",
    "jagi:astronomy-timestamp-behavior",
    "grove:call-async"
  ],
  "externalNpmPackages": [
    "@babel/runtime",
    "core-js",
    "meteor-node-stubs",
    "react"
  ],
  "generateNodeModules": true,
  "npmInstall": false
}

maybe i've missed something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants