Coder Social home page Coder Social logo

Comments (12)

jorgecasar avatar jorgecasar commented on June 14, 2024

Rollup also alert about this:

(!) `this` has been rewritten to `undefined`
https://rollupjs.org/guide/en/#error-this-is-undefined
node_modules/lit-redux-router/dist/route.js
47: }
48: 
49: var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
                     ^
50:   var c = arguments.length,
51:       r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,

from lit-redux-router.

fernandopasik avatar fernandopasik commented on June 14, 2024

Hi @jorgecasar! Thanks for opening this issue

I've added the module attribute pointing to the main typescript file.

"module": "src/lit-redux-router.ts"

from lit-redux-router.

fernandopasik avatar fernandopasik commented on June 14, 2024

Rollup also alert about this:

(!) `this` has been rewritten to `undefined`
https://rollupjs.org/guide/en/#error-this-is-undefined
node_modules/lit-redux-router/dist/route.js
47: }
48: 
49: var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
                     ^
50:   var c = arguments.length,
51:       r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,

please try again with the new version and I'll re-open this issue

from lit-redux-router.

fernandopasik avatar fernandopasik commented on June 14, 2024

fixed in https://github.com/fernandopasik/lit-redux-router/releases/tag/v0.9.6

from lit-redux-router.

jorgecasar avatar jorgecasar commented on June 14, 2024

Typescript is not a JavaScript I should use Babel to parse your library. You have to generate 2 distributions. Es modules and commonjs. Really with esm is enough because litElement is only distributed as module.

from lit-redux-router.

fernandopasik avatar fernandopasik commented on June 14, 2024

Then I think what I should do, it's just point module to dist/lit-redux-router.js as that is ES modules as well. What do you think?

from lit-redux-router.

jorgecasar avatar jorgecasar commented on June 14, 2024

Yes, it should work. In the other hand we have the roll-up issue you commented

from lit-redux-router.

fernandopasik avatar fernandopasik commented on June 14, 2024

ok, I've fixed the module property and published a new version.

Could you please provide more details on how to reproduce the issue with rollup?

from lit-redux-router.

jorgecasar avatar jorgecasar commented on June 14, 2024

I guess it's a tsconfig because running npm run build there are 2 warnings:

dist/lit-redux-router.js → dist/lit-redux-router.min.js...
(!) The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
(!) The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten

from lit-redux-router.

fernandopasik avatar fernandopasik commented on June 14, 2024

I noticed that, and the transpiled code that you posted before. Did this bring you any problem?

from lit-redux-router.

fernandopasik avatar fernandopasik commented on June 14, 2024

I think it must be to avoid conflicts with an existing polyfill declaration or something

from lit-redux-router.

fernandopasik avatar fernandopasik commented on June 14, 2024

https://rollupjs.org/guide/en/#error-this-is-undefined

I've added ignores for known warnings in the rollup config. If this causes any problems we can reopen this issue

from lit-redux-router.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.