-
Notifications
You must be signed in to change notification settings - Fork 156
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
Unable to import dateformat using browserify #170
Comments
I'm seeing the same problem when importing Version 4.6.3 works fine.
|
We are having similar a difficuly. When attempting to update dateFormat from v4.5.1 (working fine) to v5.0.1, we encountered the following error message :
We have noticed the breaking change on import format and as shown above we do use the correct import format. We are using dateFormat with webpack within a react project and no typescript. |
I'm only able to get dateformat to work on v4.6.3. v5.0.1 has this particular bug. |
v5.0.2 still has this problem |
downgrade to 3.0.* and it is working fine |
Got the same bug on 5.0.2 using TypeScript. {
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./src",
"paths": {
"@/*": ["./*"]
},
"typeRoots": ["./index.d.ts", "./node_modules/@types"],
"types": ["node"],
"incremental": true,
"skipLibCheck": true,
"resolveJsonModule": true,
}
}
import dateFormat from 'dateformat';
|
I had same problem with Jest, which runs on node. Here is my jest configuration FYI. transform: {
'^.+\\.(tsx?|js)$': 'ts-jest',
},
transformIgnorePatterns: ['node_modules/(?!dateformat)/'], |
I am unable to import dateformat using the latest version 5.0.1.
However, with version 4.6.3, it does work. I guess, that's as starting from 5.0.1, the module is not common js module anymore (?)
gave me the following error :
I use TypeScript and bundle modules with browserify using tsify as plugin in Node.js, like this:
browserify ./client/src/js/main.ts -p [ tsify -p ./client/src/tsconfig.json] -o client/src/temp/main.js
Here's part of my tsconfig.json:
I already tried importing the module using a different Typescript import form, but with no success.
As far as I saw, I use other ES modules and there was no problem, so far. So, I wonder, what am I missing here?
Thank you in advance.
The text was updated successfully, but these errors were encountered: