Vanilla install will not build
Deracination opened this issue · comments
A complete new app with typescript fails to build with error:
ERROR in ../src/router/index.ts(25,11):
TS2591: Cannot find name 'process'. Do you need to install type definitions for node? Trynpm i @types/node
and then addnode
to the types field in your tsconfig.
Using yarn: 1.21.1
node: v10.17.0
quasar: 1.4.3
@quasar/quasar-app-extension-typescript: ^1.0.0-beta.2
I created a fresh app with 'quasar create', accepted the default prompts and added ESLint, Vuex, Axios, IE11.
cd into the project directory and run quasar ext add @quasar/typescript and press enter to accept all the defaults.
Run 'quasar b' and the build fails.
If I create an app without the 'experimental' convert .js to .ts files then the app builds ok.
Output from 'quasar info':
Operating System - Linux(3.10.0-1062.9.1.el7.x86_64) - linux/x64
NodeJs - 10.17.0
Global packages
NPM - 6.11.3
yarn - 1.21.1
@quasar/cli - 1.0.5
cordova - Not installed
Important local packages
quasar - 1.6.1 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
@quasar/app - 1.4.3 -- Quasar Framework local CLI
@quasar/extras - 1.3.3 -- Quasar Framework fonts, icons and animations
vue - 2.6.11 -- Reactive, component-oriented view layer for modern web interfaces.
vue-router - 3.1.3 -- Official router for Vue.js 2
vuex - 3.1.2 -- state management for Vue.js
electron - Not installed
electron-packager - Not installed
electron-builder - Not installed
@capacitor/core - Not installed
@capacitor/cli - Not installed
@capacitor/android - Not installed
@capacitor/ios - Not installed
@babel/core - 7.7.7 -- Babel compiler core.
webpack - 4.41.3 -- Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
webpack-dev-server - 3.9.0 -- Serves a webpack app. Updates the browser on changes.
workbox-webpack-plugin - 4.3.1 -- A plugin for your Webpack build process, helping you generate a manifest of local files that workbox-sw should precache.
register-service-worker - 1.6.2 -- Script for registering service worker, with hooks
Quasar App Extensions
@quasar/quasar-app-extension-typescript - 1.0.0-beta.2 -- A Quasar CLI Extension
I managed to fix this by adding 'node' to the types array in the tsconfig. The extension is installing the @types/node package but doesn't appear to add it to the tsconfig.
"types": [ "quasar", "node" ]
It shouldn't need to do so, given how TS types resolution works
Please try with the new starter kit TypeScript
option or with TS config preset
https://quasar.dev/quasar-cli/cli-documentation/supporting-ts#Installation-of-TypeScript-Support
Let us know if you hit the same problem