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

Fixed import in CfxPinnedServers #88

Merged
merged 1 commit into from
Feb 25, 2024
Merged

Fixed import in CfxPinnedServers #88

merged 1 commit into from
Feb 25, 2024

Conversation

SeaLife
Copy link
Contributor

@SeaLife SeaLife commented Feb 24, 2024

Building a project with npx tsc failed due to:

 npx tsc                         

node_modules/cfx-api/dist/models/CfxPinnedServers.d.ts:1:42 - error TS2307: Cannot find module 'src/types/CfxPinnedServers' or its corresponding type declarations.
                                                                                                                                                                   
1 import { CfxPinnedServersResponse } from "src/types/CfxPinnedServers";                                                                                           
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                            


Found 1 error in node_modules/cfx-api/dist/models/CfxPinnedServers.d.ts:1

Modifying the import to use .. instead of src seems to be working :)

package.json:

{
  "name": "xxxxx",
  "version": "1.0.0",
  "description": "xxxxx",
  "scripts": {
    "build": "npx tsc",
    "test": "jest --coverage",
    "test:ci": "jest --coverage --ci"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "cfx-api": "^1.2.0",
    "discord-webhook-node": "^1.1.8",
    "typescript": "next"
  },
  "devDependencies": {
    "@types/jest": "^29.5.3",
    "@types/node": "^20.8.10",
    "jest": "^29.7.0",
    "jest-junit": "^16.0.0",
    "ts-jest": "^29.1.1"
  }
}

Output from CI/CD build (which is the same as local)

yarn install v1.22.19
[1/4] Resolving packages...
(node:2) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 4.44s.
yarn run v1.22.19
$ npx tsc
node_modules/cfx-api/dist/models/CfxPinnedServers.d.ts(1,[42](https://git.r3ktm8.de/SeaLife-Docker/fivem-player-tracker/-/jobs/141537#L42)): error TS2307: Cannot find module 'src/types/CfxPinnedServers' or its corresponding type declarations.
npm notice 
npm notice New minor version of npm available! 10.2.4 -> 10.4.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.4.0>
npm notice Run `npm install -g [email protected]` to update!
npm notice 
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: building at STEP "RUN yarn install && yarn build": while running runtime: exit status 2

@Ximaz Ximaz merged commit e8cc7ed into pablo-1610:master Feb 25, 2024
3 checks passed
@SeaLife SeaLife deleted the patch-1 branch February 25, 2024 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants