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

[es-dev-server]: Add context property that behaves like rollup's context option. #1062

Closed
jarrodek opened this issue Nov 28, 2019 · 3 comments
Labels
bug Something isn't working External dependency

Comments

@jarrodek
Copy link
Contributor

I am receiving an error in compatibility mode under IE11 (unfortunately I am being forced to add support for this):

TypeError: Cannot create property for a non-extensible object

I have traced this problem to the Marked library. This library is defined as follows:

(function (root) {
  var marked = ...

  if (typeof module !== 'undefined' && (typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object') {
     module.exports = marked;
  } else if (typeof define === 'function' && define.amd) {
     define(function () {
       return marked;
     });
  } else {
     root.marked = marked;
  }
})(this || (typeof window !== 'undefined' ? window : global));

It looks like this is actually defined to an empty object when this code is executed but it never gets to be added to the DOM.

In my component that uses this library I am importing marked as:

import * as marked from 'marked/lib/marked.js';
if (!window.marked) {
  window.marked = marked;
}

It works for normal mode in a normal browser. When I am building the application I am using context property of rollup. It makes it work. However when I run the demo p[age in the compatibility mode and I open the demo page in IE11 nothing gets rendered.

image

So I am looking for an option similar to rollup's context that I can set to window and be happy again.

@LarsDenBakker LarsDenBakker added the Investigating The issue is being investigated label Nov 28, 2019
@LarsDenBakker
Copy link
Member

This is an issue with the babel systemjs transform, I've filed an issue upstream: babel/babel#10775

You could monkey patch this with a responseTransformer in the meantime, let me know if you need any help with that.

@LarsDenBakker LarsDenBakker added bug Something isn't working External dependency and removed Investigating The issue is being investigated labels Nov 28, 2019
@jarrodek
Copy link
Contributor Author

I guess I will have to wait since I have about a 100 components that have this problem :)

@LarsDenBakker
Copy link
Member

This will land in babel 7.8 babel/babel#10780

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working External dependency
Projects
None yet
Development

No branches or pull requests

2 participants