-
Notifications
You must be signed in to change notification settings - Fork 47
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 resolve path to module 'export-to-csv' after upgrading to v1.2.3 #88
Comments
Could you share your It's possible your—I'm assuming react app—isn't set to work with ES modules, which is why suddenly version There are more details here about ESM vs CommonJS: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c |
facing same issue |
Maybe not the same exact issue, but seeing a similar error in our project (React and Typescript). We exclusively use ES modules, but see this error in Typescript (same thing for any export of the library):
The code compiles fine and works as we expect it to, but Typescript isn't happy about it and can't seem to find the correct (maybe any?) type information from the module. Can also confirm that Any suggestion/pointers on where to look? Happy to provide more info.
|
If you could share your It's possible it's not the exact same issue as @Catravine is experiencing, though, since they seem to be in the context of a js react project, and I suspect their issue is due to it being built for CommonJS instead of ES Modules, which has some different implications! |
Here is my
I'm trying to test different configuration options with the FWIW, I'm trying to get a reproduction case with a small basic vite template, but have been unable so far. I'll keep trying. |
I have the same issue like @sambev. Also I tried the automatic import from Intellij (to get mkConfig for example - import {mkConfig} from "export-to-csv/output/lib/config";), but then I am having another issue. Can't build because: Error: node_modules/export-to-csv/output/lib/generator.d.ts:2:46 - error TS2691: An import path cannot end with a '.ts' extension. Consider importing './types.js' instead. 2 import { CsvOutput, ConfigOptions, IO } from "./types.ts"; I think it is configuration issue, maybe I need something else in tsconfig file. |
@sambev Since you don't have an explicit If you look at the Typescript The default for I used stackblitz to build test in a new I'd recommend trying to change your @razvanGit1 |
@alexcaza { |
@nikitalukash01 I copy-pasted your I'm not sure what else the issue could be. I wonder if it might be a typescript versioning issue with your editor, or if it's using another internal config for the editor and not your project config. Feel free to try it yourself by replacing the contents of You could try adding allowImportingTsExtensions, but you need to have a build tool that isn't |
I have this and am NOT using typescript |
@titusdecali could you check to see if your Like I replied to OP in this comment, I suspect the error comes from not having ES Modules enabled in your project. The complexity of enabling ES Modules might require more than only adding/changing that property in your I'm not really in a position to help with each person's bespoke issues that come up within their build config since it's unrelated to the project. All I can do it point people in a direction. Which in this case, has to do with projects likely not being set to use ESM (which is, unfortunately, the default behaviour of |
@alexcaza |
@titusdecali great! I'm happy to hear it was resolved. :) it's possible it was an old version of Node. I'm going to keep this issue open for a few more days, and if I don't hear back from anyone else in the thread, I think I'll close it for now. |
I have the same issue as @sambev.
Node version: 18 |
I have found out following changes in version 1.2.3: |
I have the same issue as @VladislavRusin and I was tried and this is exactly us issue. Thanks @VladislavRusin save my day 💯 |
I was able to solve the issue by upgrade version Typescript form 4.9.5 to 5.4.3. |
I'm closing this issue for now but for anyone who comes across this in the future, I've listed the key takeaways below. Typescript usersIf you're having build issues, try upgrading to Typescript v5 or later. Javascript users
The crux of this issue was that from v1.2.2 to v1.2.3 of the library, some changes were made to properly build the project to use ES Modules. Before v1.2.3, the build output was incorrect for use as a true ES Module due to a configuration issue. This is why the minor version "broke" as it was an oversight on my part while switching to ES Modules for v1. If these fixes don't work, and you've tried what others suggested in the thread above, feel free to open a new issue 😄 Be sure to follow the issue template and include which versions of node, typescript, etc you're using. |
after reinstalling my packages today, I got export-to-csv v1.2.3, which caused my project not to compile; freezing the version at 1.2.2 restored functionality.
having 1.2.3 installed, then the command
npm start
, produces the error:Failed to compile.
./src/appReportTables/reportTableHelpers.js
Module not found: Can't resolve 'export-to-csv' in [...path../appReportTables]
macOS ventura 13.6.3
file referencing export-to-csv (in use with tanstack table)
The text was updated successfully, but these errors were encountered: