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

Imported helper support requires "moduleResolution": "node" in tsconfig #14

Closed
ezolenko opened this issue Apr 19, 2017 · 10 comments
Closed
Labels
solution: wontfix This will not be worked on

Comments

@ezolenko
Copy link
Owner

ezolenko commented Apr 19, 2017

Otherwise typescript can't find tslib in local node_modules. (see #12)

Running tsc without that option works, so there must be a better way of finding tslib than using require.resolve.

@ezolenko
Copy link
Owner Author

@vardius
Copy link

vardius commented Jun 28, 2017

Any solutions for this one ? My build with rollup works, but then when I am using my lib in node projects i get this error: Cannot find module 'tslib' from 'bundle.js'

@ezolenko
Copy link
Owner Author

That shouldn't happen... Did you set tslib as an external dependency in rollup config?

What's you rollup / typescript versions and what does top of your transpiled bundle look like? Does it have import/require tslib?

@vardius
Copy link

vardius commented Jun 29, 2017

I have var tslib_1 = require("tslib");

Versions:

    "rollup": "^0.43.0",
    "tslib": "^1.7.1",
    "tslint": "^5.4.3",
    "typescript": "^2.4.1"

and my config is:

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "rootDir": "src",
    "outDir": ".code",
    "newLine": "LF",
    "lib": [
      "es2015",
      "es2016",
      "es2017",
      "dom",
      "scripthost"
    ],
    "moduleResolution": "node",
    "importHelpers": true,
    "declaration": true,
    "pretty": true,
    "sourceMap": true,
    "inlineSources": true,
    "noUnusedLocals": true,
    "skipLibCheck": true
  },
  "include": [
    "src/**/*"
  ],
  "exclude": [
    "node_modules",
    "**/*.spec.ts",
    "dist",
    "es",
    "lib"
  ]
}

@ezolenko
Copy link
Owner Author

What your rollup config look like?

Also, try with "rollup-plugin-typescript2": "github:ezolenko/rollup-plugin-typescript2#master" instead of 0.4.4 -- I just (hopefully) fixed a bug related to typescript 2.4.1.

@vardius
Copy link

vardius commented Jun 29, 2017

  moduleName: pascalCase(pkg.name),
  entry: "src/index.ts",
  dest: "dist/bundle.js",
  format: "umd",
  exports: "named",
  sourceMap: true,
  plugins: [
    typescript(),
    sourcemaps(),
    resolve({
      jsnext: true,
      browser: true
    }),
    commonjs(),
    globals(),
    builtins(),
    uglify()
  ]

@ezolenko
Copy link
Owner Author

Could you run the build with typescript({ clean: true, verbosity: 3 }), (on master branch) and post the output?

Also post your package config (the part with all the rollup plugins).

It is possible one of those plugins clobbers tslib resolution and it doesn't get replaced by this plugin...

@vardius
Copy link

vardius commented Jun 29, 2017

With the master branch it does work. Could you release it ?

@ezolenko
Copy link
Owner Author

Cool, I'll release later today.

@ezolenko
Copy link
Owner Author

ezolenko commented Jul 1, 2017

Back to original bug, reading typescript documentation it seems classic resolution is mostly for backwards compatibility anyway, so closing as won't fix.

@ezolenko ezolenko closed this as completed Jul 1, 2017
@agilgur5 agilgur5 added the solution: wontfix This will not be worked on label May 21, 2022
Repository owner locked as resolved and limited conversation to collaborators May 22, 2022
@agilgur5 agilgur5 changed the title Imported helper support requires "moduleResolution": "node" in tsconfig Imported helper support requires "moduleResolution": "node" in tsconfig May 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
solution: wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants