Skip to content
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

Degiro conversion error - module not found #65

Closed
alex27riva opened this issue May 5, 2024 · 16 comments · Fixed by #66
Closed

Degiro conversion error - module not found #65

alex27riva opened this issue May 5, 2024 · 16 comments · Fixed by #66
Labels
Bug Something isn't working DEGIRO Related to DEGIRO

Comments

@alex27riva
Copy link

Hi everyone.
I'm trying to convert my order history exported from Degiro but I'm getting the following error:

➜  Export-To-Ghostfolio git:(main) npm run start degiro

> export-to-ghostfolio@1.0.0 start
> tsx ./src/manual.ts "degiro"


node:internal/process/esm_loader:34
      internalBinding('errors').triggerUncaughtException(
                                ^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/username/Scaricati/Export-To-Ghostfolio/node_modules/dayjs/plugin/customParseFormat' imported from /home/username/Scaricati/Export-To-Ghostfolio/src/converters/degiroConverter.ts
Did you mean to import "dayjs/plugin/customParseFormat.js"?
    at finalizeResolution (node:internal/modules/esm/resolve:265:11)
    at moduleResolve (node:internal/modules/esm/resolve:933:10)
    at defaultResolve (node:internal/modules/esm/resolve:1157:11)
    at nextResolve (node:internal/modules/esm/hooks:866:28)
    at S (file:///home/username/Scaricati/Export-To-Ghostfolio/node_modules/tsx/dist/esm/index.mjs?1714900896692:2:2951)
    at nextResolve (node:internal/modules/esm/hooks:866:28)
    at Hooks.resolve (node:internal/modules/esm/hooks:304:30)
    at handleMessage (node:internal/modules/esm/worker:196:24)
    at Immediate.checkForMessages [as _onImmediate] (node:internal/modules/esm/worker:138:28)
    at process.processImmediate (node:internal/timers:478:21) {
  code: 'ERR_MODULE_NOT_FOUND',
  url: 'file:///home/username/Scaricati/Export-To-Ghostfolio/node_modules/dayjs/plugin/customParseFormat'
}
Node.js v20.12.2

Same issue when using Docker image or local build.
I'm on Fedora 40, Node version v20.12.2

@dickwolff
Copy link
Owner

Seems to be the same issue as #64. Can you try and run npm install and then run the tool again?

@alex27riva
Copy link
Author

Seems to be the same issue as #64. Can you try and run npm install and then run the tool again?

Sorry for the duplicate Issue, i ran npm install but still same error

@dickwolff
Copy link
Owner

dickwolff commented May 5, 2024

As a test, can you run npm install dayjs and then run again? This seemed to have resolved the issue on my machine.

It should update the dayjs dependency from 1.11.10 to 1.11.11.

@alex27riva
Copy link
Author

As a test, can you run npm install dayjs and then run again? This seemed to have resolved the issue on my machine.

It should update the dayjs dependency from 1.11.10 to 1.11.11.

Same error again.
Dependences list:

➜  Export-To-Ghostfolio git:(main) ✗ npm list            
export-to-ghostfolio@1.0.0 /home/username/Scaricati/Export-To-Ghostfolio
├── @types/cacache@17.0.2
├── @types/cli-progress@3.11.5
├── @types/jest@29.5.12
├── @types/node@20.12.8
├── cacache@18.0.3
├── chokidar@3.6.0
├── cli-progress@3.12.0
├── closest-match@1.3.3
├── csv-parse@5.5.5
├── dayjs@1.11.11
├── dotenv@16.4.5
├── jest@29.7.0
├── ts-jest@29.1.2
├── ts-node@10.9.2
├── tsx@4.9.1
├── typescript@5.4.5
└── yahoo-finance2@2.11.2

@dickwolff
Copy link
Owner

dickwolff commented May 5, 2024

Thanks. I do see some mismatches in versions I have locally. Will look into this when I have some time later today.

I think this error is due to my migration from commonjs to esm and there were some import things I had to change.


Edit: Yep, I updated tsx to the latest version (I had 4.7.2, now 4.9.1) and I have the same issue as you do. Will try and find a fix!

@dickwolff
Copy link
Owner

When you install tsx 4.9.0 manually you can run the tool again. Something broke in tsx 4.9.1. Will push a hard pinned fix now and then look into resolving 4.9.1+

@dickwolff
Copy link
Owner

Closed by accident. Can you verify if this fix works?

@dickwolff
Copy link
Owner

Issue is already known at tsx. Fill follow this.

@dickwolff dickwolff added the Bug Something isn't working label May 5, 2024
@alex27riva
Copy link
Author

Closed by accident. Can you verify if this fix works?

The fix works, but I the conversion fails with either degiro or degiro-v2.

> export-to-ghostfolio@1.0.0 start
> tsx ./src/manual.ts "degiro"

[i] Restored 0 ISIN-symbol pairs and 0 symbols from cache..
[i] Processing file using DeGiro converter
[i] NOTE: There is a new version available of the DeGiro converter
[i] The new converter has multiple record parsing improvements and also supports platform fees.
[i] The new converter is currently in beta and we're looking for your feedback!
[i] You can run the beta converter with the command 'npm run start degiro-v2'.
[i] Read CSV file. Start processing..
███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 8% | ETA 0s | Duration: 2s | 8/93/home/username/Scaricati/Ex9
            if (result.activities[result.activities.length - 1].comment === "txfees") {
                                                                

TypeError: Cannot read properties of undefined (reading 'comment')
    at <anonymous> (/home/username/Scaricati/Export-To-Ghostfolio/src/converters/degiroConverter.ts:1)
➜  Export-To-Ghostfolio git:(main) npm run start degiro-v2

> export-to-ghostfolio@1.0.0 start
> tsx ./src/manual.ts "degiro-v2"

[i] Restored 1 ISIN-symbol pairs and 1 symbols from cache..
[i] Processing file using DeGiro converter (V2 Beta)
[i] NOTE: You are running a converter that is currently in beta.
[i] If you have any issues, please report them on GitHub. Many thanks!
[i] Read CSV file. Start processing..
[d]     Retrieved symbol IE00BK5BQT80.SG from cache!
[d] 	Retrieved symbol IE00BK5BQT80.SG from cache!
[d] 	Retrieved symbol IE00BK5BQT80.SG from cache!
[d] 	Retrieved symbol IE00BK5BQT80.SG from cache!
[d] 	Retrieved symbol IE00BK5BQT80.SG from cache!
[d] 	Retrieved symbol IE00BK5BQT80.SG from cache!
[d] 	Retrieved symbol IE00BK5BQT80.SG from cache!
[d] 	Retrieved symbol IE00BK5BQT80.SG from cache!
[d] 	Retrieved symbol IE00BK5BQT80.SG from cache!
[d] 	Retrieved symbol IE00BK5BQT80.SG from cache!
[d] 	Retrieved symbol IE00BK5BQT80.SG from cache!
[d] 	Retrieved symbol IE00BK5BQT80.SG from cache!
[d] 	Retrieved symbol IE00BK5BQT80.SG from cache!
[d] 	Retrieved symbol IE00BK5BQT80.SG from cache!
[d]             getSymbolsByQuery(): No match found when searching by name for NL0010661914. Trying a p.
[d]     getSecurity(): Found 0 matches by ISIN NL0010661914
[d] 	getSecurity(): No match found for symbol not provided, trying by name FUNDSHARE UCITS EUR CASH D
[d]             getSymbolsByQuery(): No match found when searching by name for FUNDSHARE UCITS EUR CASH.
[i] No result found for NL0010661914 with currency EUR! Please add this manually..
[d]             getSymbolsByQuery(): No match found when searching by name for NL0010661914. Trying a p.
[d] 	getSecurity(): Found 0 matches by ISIN NL0010661914
[d] 	getSecurity(): No match found for symbol not provided, trying by name FUNDSHARE UCITS EUR CASH D
████████████████████████████████████████ 100% | ETA 0s | Duration: 1s | 93/93
[i] Processing complete, writing to file..
[i] Wrote data to 'e2g-output/ghostfolio-degiro-v2-20240505132743.json'!
[i] You can now automatically validate the generated file against Ghostfolio. Set GHOSTFOLIO_VALIDATE=true in your environment variables to enable this feature.
[i] You can now automatically import the generated file into Ghostfolio. Set GHOSTFOLIO_IMPORT=true in your environment variables to enable this feature
[i] THIS IS AN EXPERIMENTAL FEATURE!! Use this at your own risk!

@dickwolff
Copy link
Owner

I haven't put effort in the old DEGIRO converter because I want to replace it with the V2. I can try to fix the old one it but I prefer people move to V2.

It seems (according to the logs), the V2 converter succeeds and outputs a file. What exactly do you mean it fails? Does the V2 output file not import in Ghostfolio?

@alex27riva
Copy link
Author

I haven't put effort in the old DEGIRO converter because I want to replace it with the V2. I can try to fix the old one it but I prefer people move to V2.

It seems (according to the logs), the V2 converter succeeds and outputs a file. What exactly do you mean it fails? Does the V2 output file not import in Ghostfolio?
I can't import the file to Ghostfolio because a Symbol is missing
Schermata del 2024-05-05 13-51-45

@dickwolff
Copy link
Owner

dickwolff commented May 5, 2024

Do you perhaps have a clean Ghostfolio setup (without any previous activities)? I had the same issue yesterday when I did a clean install. Whatever symbol I entered, nothing was accepted. I believe I had to do a market sync job before it worked, but I don't recall exactly what I did that made it work.

@alex27riva
Copy link
Author

Do you perhaps have a clean Ghostfolio setup (without any previous activities)? I had the same issue yesterday when I did a clean install. Whatever symbol I entered, nothing was accepted.

Yes

@dickwolff dickwolff added the DEGIRO Related to DEGIRO label May 5, 2024
@dickwolff dickwolff mentioned this issue May 6, 2024
3 tasks
@dickwolff
Copy link
Owner

Gotcha, that's a Ghostfolio issue then. @dtslvr Do you have Instructions somewhere on how to do the initial setup with Yahoo symbols?

@dtslvr
Copy link

dtslvr commented May 6, 2024

Yes

@alex27riva which version of Ghostfolio are you using?

@dickwolff
Copy link
Owner

Closing due to inactivity, and because it's not an issue with export to Ghostfolio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working DEGIRO Related to DEGIRO
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants