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

trouble: bundle with r.js not works #203

Closed
khoden opened this issue Oct 6, 2015 · 3 comments
Closed

trouble: bundle with r.js not works #203

khoden opened this issue Oct 6, 2015 · 3 comments
Assignees

Comments

@khoden
Copy link

khoden commented Oct 6, 2015

Your build_example/r.js example not works.

In console there is error:

Uncaught Error: Mismatched anonymous define() module: function (__WEBPACK_EXTERNAL_MODULE_1__) {

Unfortunately in my project there is same error after create bundle((

I know, errors is in

if(typeof define === 'function' && define.amd)
        define(["angular"], factory);

For bundled file requirejs expected this syntax:

define('/path/to/angular-cache/dist/angular-cache', ['angular'], factory)
@jmdobry
Copy link
Owner

jmdobry commented Oct 12, 2015

I just did:

  1. clone [email protected]:jmdobry/angular-cache.git && cd angular-cache
  2. npm install
  3. grunt build
  4. cd build_examples/r.js
  5. r.js -o require.config.js

and it worked, including opening index.html and running the code. So...closing because I’m not sure this is an issue, if you are convinced that this is really a bug, please feel free to re-open the issue and add more information:

  • good - Your versions of Angular, Angular-cache, etc, relevant console logs/error, code examples that revealed the issue
  • better - A plnkr, fiddle, or bin that demonstrates the issue
  • best - A Pull Request that fixes the issue, including test coverage for the issue and the fix

Otherwise support is done via the mailing list.

@jmdobry jmdobry closed this as completed Oct 12, 2015
@khoden
Copy link
Author

khoden commented Oct 12, 2015

Please open index.html and switch to use production version (bundled).

Just this way:

<head>
  <title>My App</title>
  <!-- load scripts dynamically -->
  <!-- <script data-main="main" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.17/require.min.js"></script> -->

  <!-- load bundled scripts -->
<script data-main="bundle" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.17/require.min.js"></script>
</head>

@jmdobry
Copy link
Owner

jmdobry commented Oct 13, 2015

I've run into this before, which is why I filed webpack/webpack#989, but I thought I fixed it...

@jmdobry jmdobry reopened this Oct 13, 2015
@jmdobry jmdobry added the bug label Oct 13, 2015
@jmdobry jmdobry self-assigned this Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants