In ES6 projects overflows console with typescript warning
See original GitHub issueSorry, I don’t know how to demonstrate this on a JSFiddle, as I can’t see the console output there.
I do NOT use Typescript, but ES6 via Babel.
After upgrade from 4.2.0 to 4.2.1 (or any higher version) the project build and the browser console is overflown with 111 messages. This effectively prevents development of the app, as I need to have the console clean to easily spot any issues with my own code.
Browser console output:
[HMR] bundle has 111 warnings
./node_modules/flatpickr/dist/l10n/ar.d.ts
Module parse failed: /home/..../frontend/node_modules/flatpickr/dist/l10n/ar.d.ts Unexpected token (2:7)
You may need an appropriate loader to handle this file type.
| import { CustomLocale } from "../types/locale";
| export declare const Arabic: CustomLocale;
| declare const _default: {
| ar?: CustomLocale | undefined;
@ ./node_modules/flatpickr/dist/l10n ^\.\/.*$
@ ./src/main.js
@ multi ./build/dev-client ./src/main.js
./node_modules/flatpickr/dist/l10n/bg.d.ts
Module parse failed: /home/..../frontend/node_modules/flatpickr/dist/l10n/bg.d.ts Unexpected token (2:7)
You may need an appropriate loader to handle this file type.
| import { CustomLocale } from "../types/locale";
| export declare const Bulgarian: CustomLocale;
| declare const _default: {
| ar?: CustomLocale | undefined;
@ ./node_modules/flatpickr/dist/l10n ^\.\/.*$
@ ./src/main.js
@ multi ./build/dev-client ./src/main.js
./node_modules/flatpickr/dist/l10n/bn.d.ts
Module parse failed: /home/..../frontend/node_modules/flatpickr/dist/l10n/bn.d.ts Unexpected token (2:7)
You may need an appropriate loader to handle this file type.
| import { CustomLocale } from "../types/locale";
| export declare const Bangla: CustomLocale;
| declare const _default: {
| ar?: CustomLocale | undefined;
@ ./node_modules/flatpickr/dist/l10n ^\.\/.*$
@ ./src/main.js
@ multi ./build/dev-client ./src/main.js
./node_modules/flatpickr/dist/l10n/cat.d.ts
Module parse failed: /home/..../frontend/node_modules/flatpickr/dist/l10n/cat.d.ts Unexpected token (2:7)
You may need an appropriate loader to handle this file type.
| import { CustomLocale } from "../types/locale";
|
etc. the rest omitted.
I would assume that this is related to issue #1131 and commit 6b4ff17d7b0c33353413f391b90a56a7075c5cd9. (I might also speculate that maybe some dist JS files refer to .ts files?)
Please advise how to get rid of these messages.
Your Environment
- flatpickr version used: 4.2.1
- Browser name and version: Chrome
- OS and version: Centos 7.1
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
nuxt.js - bundle 'client' has 221 warnings in typescript in console
I solved My Issue By changing the tsconfig.json. from This: { "compilerOptions": { "target": "ESNext", "module": "ESNext", ...
Read more >Documentation - ECMAScript Modules in Node.js - TypeScript
This setting controls whether .js files are interpreted as ES modules or CommonJS modules, and defaults to CommonJS when not set. When a...
Read more >TypeScript: JavaScript With Syntax For Types.
TypeScript extends JavaScript by adding types to the language. TypeScript speeds up your development experience by catching errors and providing fixes ...
Read more >TSConfig Reference - Docs on every TSConfig option
Project references are a way to structure your TypeScript programs into ... These warnings are only about code which is provably unreachable due...
Read more >The starting point for learning TypeScript
Find TypeScript starter projects: from Angular to React or Node.js and CLIs.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just for the info, I have finally found the cause.
The
require
call for flatpickr locale assumed a.js
extension will be added by webpack by default, but the.d.ts
file was loaded as well. Changing it to this made the trick:My bad.
Created a new plain project with just flatpickr and could not reproduce the issue. Probably something with the vue component wrapper. Sorry.