question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No compiler errors compared to tsc

See original GitHub issue

Hi,

I’m trying to use the plugin, however I’m getting no compiler errors at all when building with rollup, compared to running tsc.

Here’s the output from tsc:

src/main/ts/core/api/track-event.ts(83,17): error TS2345: Argument of type 'string' is not assignable to parameter of type 'ZeptoEventHandlers'.
src/main/ts/core/content/renderers/helpers/renderer-helpers.ts(71,12): error TS2345: Argument of type '"load"' is not assignable to parameter of type 'ZeptoEventHandlers'.
src/main/ts/core/content/renderers/helpers/renderer-helpers.ts(77,12): error TS2345: Argument of type '"error"' is not assignable to parameter of type 'ZeptoEventHandlers'.
src/main/ts/core/content/renderers/set-attribute.ts(26,12): error TS2345: Argument of type '"load"' is not assignable to parameter of type 'ZeptoEventHandlers'.
src/main/ts/core/content/renderers/set-attribute.ts(31,12): error TS2345: Argument of type '"error"' is not assignable to parameter of type 'ZeptoEventHandlers'.
src/main/ts/foundation/zepto.ts(1621,14): error TS2322: Type '(selector: any, context: any) => any' is not assignable to type 'ZeptoStatic'.
  Property 'camelCase' is missing in type '(selector: any, context: any) => any'.

Here’s my rollup config:

import typescript from 'rollup-plugin-typescript2';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import path from 'path';
import license from 'rollup-plugin-license';
import cleanup from 'rollup-plugin-cleanup';

export default {
  entry: './src/main/ts/bootstrap.ts',

  format: 'iife',

  moduleName: 'testmodule',

  dest: './dist/out.js',

  sourceMap: false,

  plugins: [
    typescript({
      check: true,
      include: [ "*.ts+(|x)", "**/*.ts+(|x)" ]
	}),
    resolve({
      jsnext: true,
      main: true,
      browser: true
	}),
    commonjs({
      include: 'node_modules/**',
      exclude: [ 'node_modules/@types/**' ],
      extensions: [ '.js' ],
      ignoreGlobal: false,
      sourceMap: false,
      namedExports: {
        'node_modules/js-cookie/src/js.cookie.js': [ 'get', 'set', 'remove']
      }
    }),
    license({
      sourceMap: true,
      banner: {
        file: path.join(__dirname, 'tools/decorations/license.txt')
      }
    }),
    cleanup({
      comments: 'some'
    })
  ]
}

And tsconfig.json:

{
  "compilerOptions": {
    "module": "commonjs",
    "moduleResolution": "node",
    "target": "es5",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "noImplicitAny": false,
    "removeComments": false,
    "noEmitHelpers": true,
    "sourceMap": false,
    "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "maxNodeModuleJsDepth": 1,
    "types" : [
      "es6-shim",
      "js-cookie",
      "query-string"
    ]
  },
  "include": [
    "**/*.ts"
  ],
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false,
  "buildOnSave": false
}

I’m using TypeScript v2.2.1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
ezolenkocommented, Mar 9, 2017

re: Cannot write file because it would overwrite input file, there is report on typescript about similar issues. So likely not related to this plugin: https://github.com/Microsoft/TypeScript/issues/14538

1reaction
ezolenkocommented, May 7, 2022

@jdalrymple this is expected – the plugin sets moduleResolution: node regardless of what is in tsconfig (see readme for this and other enforced options).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does the tsc command not show compiling errors when ...
However when I run tsc app.ts I get no error at all and the app.js file is produced! Not what I'd expect. Why...
Read more >
Avoid TypeScript errors in your project by using the TypeScript ...
No more unexpected type errors! ... Assuming you are new to TypeScript, tsc is The TypeScript Compiler. It is a tool responsible for...
Read more >
Documentation - tsc CLI Options - TypeScript
Flag Type Default ‑‑allowJs boolean false ‑‑allowUmdGlobalAccess boolean false ‑‑allowUnreachableCode boolean
Read more >
TypeScript tutorial with Visual Studio Code
... TypeScript language support but does not include the TypeScript compiler, tsc . ... You can see type checking errors in VS Code...
Read more >
Troubleshooting | ts-node - TypeStrong · GitHub
Type errors from the compiler are thrown as a TSError . These are the same as errors you get from tsc . SyntaxError...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found