Files
tsgo/testdata/baselines/reference/submodule/compiler/elidedJSImport1.errors.txt

31 lines
1.8 KiB
Plaintext

caller.js(1,21): error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.
caller.js(2,8): error TS18042: 'TruffleContract' is a type and cannot be imported in JavaScript files. Use 'import("@truffle/contract")' in a JSDoc type annotation.
caller.js(4,43): error TS2708: Cannot use namespace 'TruffleContract' as a value.
caller.js(4,60): error TS2708: Cannot use namespace 'TruffleContract' as a value.
==== caller.js (4 errors) ====
import * as fs from 'fs';
~~~~
!!! error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.
import TruffleContract from '@truffle/contract'; // Runtime err: this import is elided in transform
~~~~~~~~~~~~~~~
!!! error TS18042: 'TruffleContract' is a type and cannot be imported in JavaScript files. Use 'import("@truffle/contract")' in a JSDoc type annotation.
console.log(fs);
console.log('TruffleContract is ', typeof TruffleContract, TruffleContract); // `TruffleContract` is considered 'unused'
~~~~~~~~~~~~~~~
!!! error TS2708: Cannot use namespace 'TruffleContract' as a value.
~~~~~~~~~~~~~~~
!!! error TS2708: Cannot use namespace 'TruffleContract' as a value.
==== node_modules/@truffle/contract/index.d.ts (0 errors) ====
declare module "@truffle/contract" {
interface ContractObject {
foo: number;
}
namespace TruffleContract {
export type Contract = ContractObject;
}
export default TruffleContract;
}