-
Notifications
You must be signed in to change notification settings - Fork 50
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
Typescript definitions are not included the package #33
Comments
Will add this, thanks! |
I added an index.d.ts file. Can you check if this is working for you? Type definitions are now included in /dist/lib/types/index.d.ts npm i --save [email protected] https://www.npmjs.com/package/vuejs-logger/v/1.5.4-beta.2 Thanks! |
Not working in the latest version as well as the version you mentioned in the comment. Issue 1 Error Details for Issue 1: // Register vue logger
const logModes = ['debug', 'info', 'warn', 'error', 'fatal'];
const options = {
isEnabled: true,
logLevel: logModes.indexOf(process.env.VUE_APP_LOGLEVEL) === -1 ? 'debug' : process.env.VUE_APP_LOGLEVEL,
stringifyArguments: false,
showLogLevel: true,
showMethodName: true,
separator: '|',
showConsoleColors: true,
};
Vue.use(VueLogger, options);
|
Thanks @thiyagarajan-a, let me check that. |
Thanks @justinkames, I think, it would be easy track if we keep the issue as open. |
@thiyagarajan-a can you try again with version 1.5.5-beta.1, this should solve it. Will create 1.5.5 if it is ok. |
Okay! will do it right away. |
No still the issue is there. But with different error it seems.
|
@justinkames I have updated my vuejs fro 2.6.10 to 2.6.11. Now the VueLogger issue is resolved. But this issue still exists |
@thiyagarajan-a Thanks for the quick reply! What TS version are you using? I tested with : "typescript": "3.7.5" Thanks! Sample project dependencies for me are >
|
TS version is 3.7.3 "dependencies": {
"@babel/polyfill": "^7.7.0",
"axios": "^0.19.2",
"core-js": "^2.6.5",
"custom-event-polyfill": "^1.0.7",
"iframe-coordinator": "^4.0.2",
"url-polyfill": "^1.1.7",
"vue": "2.6.11",
"vue-class-component": "^7.0.2",
"vue-property-decorator": "^8.1.0",
"vue-router": "^3.0.3",
"vuejs-logger": "^1.5.5-beta.1",
"vuex": "^3.0.1"
}, "devDependencies": {
"@types/jest": "^23.1.4",
"@vue/cli-plugin-babel": "^3.12.0",
"@vue/cli-plugin-e2e-cypress": "^3.12.0",
"@vue/cli-plugin-typescript": "^3.12.0",
"@vue/cli-plugin-unit-jest": "^3.12.0",
"@vue/cli-service": "^3.12.0",
"@vue/test-utils": "1.0.0-beta.30",
"babel-core": "7.0.0-bridge.0",
"concurrently": "^5.0.2",
"guid-typescript": "^1.0.9",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"lint-staged": "^8.1.5",
"ts-jest": "^23.0.0",
"typescript": "^3.4.3", // installed version is 3.7.3
"vue-template-compiler": "^2.6.10"
}, |
Strange situation, I cannot reproduce it just yet. |
Let me create a basic vue app and test it from scratch. |
Thanks! |
https://github.com/Thiyagarajan-A/basic-vue I am able to reproduce the issue. The exact repo is given in the link above. |
Thanks @thiyagarajan-a im on it |
I'm having the same issue; [email protected], [email protected], [email protected]:
I was able to fix it with something like this, in a declare module 'vue/types/vue' {
interface VueConstructor {
// $log is both global and per-instance
$log: {
debug(...args: any[]): void;
info(...args: any[]): void;
warn(...args: any[]): void;
error(...args: any[]): void;
fatal(...args: any[]): void;
};
} |
I have the same problem with the version I have running the version I use: "vue": "^2.6.11",
"typescript": "~3.7.5" |
Hi everyone, I am still struggling with Typescript import system. However, I found that this code is working for me: // For unknown reason, we need the first import to declare $log on Vue
// and the second to get the correct plugin type
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import VueLogger from 'vuejs-logger'
import VueLoggerPlugin from 'vuejs-logger/dist/vue-logger'
const debug = process.env.NODE_ENV !== 'production'
Vue.use(VueLoggerPlugin, {
// options
}) It works with |
Was this resolved? Running into same issue with TypeScript 3.8.3, Vue 2.6.11 and Vuejs-logger 1.10.2. Looks like the 1.10.2 version does not include the index.d.ts (type definition) file. Reverted to 1.5.4 and it has the Type Definition file. Is the versioning wrong? i.e. 1.10.2 older than 1.5.4? Also had to do: Hope these fixes gets baked into the next version. |
Im using ts with vue 2.6.14 and // /main.ts
import VueLoggerPlugin from "vuejs-logger/dist/vue-logger";
const isProduction = process.env.NODE_ENV === "production";
const options = {
isEnabled: true,
logLevel: isProduction ? "error" : "debug",
stringifyArguments: false,
showLogLevel: true,
showMethodName: true,
separator: "|",
showConsoleColors: true,
};
Vue.config.productionTip = false;
new Vue({
router,
store,
vuetify,
render: (h) => h(App),
}).$mount("#app");
Vue.use(VueLoggerPlugin, options); Hope this helps someone. |
It would be good to include the definitions along with this package.
Right now the following code needs to be included in the VueJS app in order to make the typescript recognise them.
The text was updated successfully, but these errors were encountered: