ip-tools / patzilla

PatZilla is a modular patent information research platform and data integration toolkit with a modern user interface and access to multiple data sources.
https://docs.ip-tools.org/patzilla/
GNU Affero General Public License v3.0
99 stars 22 forks source link

TS18002: The 'files' list in config file 'tsconfig.json' is empty. #19

Open DefteZ opened 5 years ago

DefteZ commented 5 years ago

It is impossible to build java-script stuff. yarn run build fails with next log output:

[../../../patzilla-ui/vendor/widget/raty/jquery.raty.js] /opt/Patzilla/patzilla-ui/vendor/widget/raty/jquery.raty.js 17.5 KiB {app-standalone} {app-embedded} [depth 6] [built]
    + 372 hidden modules

ERROR in [tsl] ERROR
      TS18002: The 'files' list in config file 'tsconfig.json' is empty.
 @ /opt/Patzilla/patzilla-ui/navigator/app/document/document-controller.js 5:15-64
 @ /opt/Patzilla/patzilla-ui/navigator/app/document/index.js
 @ /opt/Patzilla/patzilla-ui/navigator/boot/loader.js
 @ /opt/Patzilla/patzilla-ui/navigator/boot/standalone.js
 @ multi /opt/Patzilla/patzilla-ui/navigator/boot/standalone

ERROR in /opt/Patzilla/patzilla-ui/navigator/components/nataraja/index.ts
Module build failed (from /opt/Patzilla/node_modules/ts-loader/index.js):
Error: error while parsing tsconfig.json
    at Object.loader (/opt/Patzilla/node_modules/ts-loader/dist/index.js:19:18)
 @ /opt/Patzilla/patzilla-ui/navigator/app/document/document-controller.js 5:15-64
 @ /opt/Patzilla/patzilla-ui/navigator/app/document/index.js
 @ /opt/Patzilla/patzilla-ui/navigator/boot/loader.js
 @ /opt/Patzilla/patzilla-ui/navigator/boot/standalone.js
 @ multi /opt/Patzilla/patzilla-ui/navigator/boot/standalone
error Command failed with exit code 2.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

amotl commented 5 years ago

Dear Andrii,

thanks for writing in and reporting this issue to us. From reading about ts-loader in the stacktrace (thanks for that!), we conclude this is most probably related to the recent addition of TypeScript to the frontend.

With kind regards, Andreas.

DefteZ commented 5 years ago

steps to reproduce:

git clone https://github.com/ip-tools/ip-navigator.git
cd ip-navigator/
git checkout 22a7c74cfe2377335ae34df0abc1e642a5595355
virtualenv --python=python2 .venv27 && source .venv27/bin/activate
pip install -e . 
pip install nodeenv
nodeenv --node=10.15.3 .nodeenv
source .nodeenv/bin/activate && npm install -g yarn && yarn install
yarn run build
amotl commented 5 years ago

Dear Andrii,

it looks like the referenced tsconfig.json file was missing completely, so we just added it with 70dfd823. Thanks for spotting this!

Please let us know whether that solves this issue for you.

With kind regards, Andreas.

amotl commented 5 years ago

Dear Andrii,

do you have any news on this?

With kind regards, Andreas.

DefteZ commented 5 years ago

Fixed

rupuengg commented 1 year ago

I am still facing the same issue.

tsconfig.json

{
  "include": [
    "patzilla-ui"
  ],
  "compileOnSave": true,
  "compilerOptions": {
    "target": "es5",
    "module": "esnext",
    "rootDir": "./patzilla-ui",
    "baseUrl": "./patzilla-ui",
    "lib": [
      "dom",
      "es2015",
      "es2016"
    ],
    "declaration": false,
    "allowSyntheticDefaultImports": true,
    "inlineSourceMap": false,
    "sourceMap": true,
    "jsx": "react",
    "noEmitOnError": false,
    "emitDecoratorMetadata": false,
    "experimentalDecorators": true,
    "noImplicitReturns": true,
    "noImplicitThis": false,
    "noImplicitUseStrict": false,
    "noImplicitAny": false,
    "noUnusedLocals": false,
    "strictNullChecks": true,
    "moduleResolution": "node",
    "esModuleInterop": true
  }
}

webpacl.config.js

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
// const REACT_APP_ENV = process.env.REACT_APP_ENV;

module.exports = {
  mode: 'delelopment',
  entry: './src/main.tsx',
  devtool: 'inline-source-map',
  output: {
    path: path.join(__dirname, '/dist'),
    filename: 'bundle.js'
  },
  devServer: {
    static: './dist'
  },
  module: {
    rules: [
      {
        use: ['babel-loader'],
        test: /\.(js\jsx)$/,
        exclude: /node_modules/
      },
      {
        test: /\.tsx?$/,
        use: 'ts-loader',
        exclude: /node_modules/
      },
      {
        test: /\.s?css$/,
        use: ['style-loader', 'css-loader', 'sass-loader']
      }
    ]
  },
  resolve: {
    extensions: [
      '.tsx', '.ts', '.js'
    ]
  },
  target: ['web', 'es5'],
  plugins: [
    new HtmlWebpackPlugin({
      template: './public/index.html'
    })
  ]
};

package.json

{
  "name": "pwatlas",
  "version": "1.0.0",
  "description": "pwatlas",
  "main": "main.js",
  "scripts": {
    "start": "webpack-dev-server --open --mode development --hot",
    "build": "webpack --mode production",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Rupendra",
  "license": "ISC",
  "devDependencies": {
    "@babel/core": "^7.21.8",
    "@babel/preset-env": "^7.21.5",
    "@babel/preset-react": "^7.18.6",
    "@types/node": "^20.2.3",
    "babel-loader": "^9.1.2",
    "html-webpack-plugin": "^5.5.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "ts-loader": "^9.4.2",
    "typescript": "^5.0.4",
    "webpack": "^5.83.1",
    "webpack-cli": "^5.1.1",
    "webpack-dev-server": "^4.15.0"
  },
  "dependencies": {
    "@types/react": "^18.2.6",
    "@types/react-dom": "^18.2.4"
  }
}

Problem

After running app using npm run start. image

amotl commented 1 year ago

Dear Rupendra,

thank you for writing in. I am not sure if this is the right spot. Are you sure you are using PatZilla? Your package.json refers to a project called pwatlas. Please clarify how this is related to PatZilla.

Other than this, PatZilla's instructions how to setup a development sandbox can be found at ^1. Please let me know if you observe any specific problems following the steps outlined there.

With kind regards, Andreas.