question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues when upgrading to 0.6.0

See original GitHub issue

When I upgraded sandstone to 0.6.0 in my project, I got this error message.

console error message > npx ts-node index.ts

Error: Cannot define namespace under a base path. at BasePathClass.getName (C:\Users\Beatso\OneDrive\Documents\Minecraft\datapacks\SurvivalistsVsHitmen\src_internals\datapack\BasePath.ts:49:13)
at Object.BasePathClass.MCFunction (C:\Users\Beatso\OneDrive\Documents\Minecraft\datapacks\SurvivalistsVsHitmen\src_internals\datapack\BasePath.ts:137:64) at Object.<anonymous> (C:\Users\Beatso\OneDrive\Documents\Minecraft\datapacks\SurvivalistsVsHitmen\index.ts:27:1) at Module._compile (internal/modules/cjs/loader.js:1138:30) at Module.m._compile (C:\Users\Beatso\OneDrive\Documents\Minecraft\datapacks\SurvivalistsVsHitmen\node_modules\ts-node\src\index.ts:1043:23)
at Module._extensions…js (internal/modules/cjs/loader.js:1158:10) at Object.require.extensions.<computed> [as .ts] (C:\Users\Beatso\OneDrive\Documents\Minecraft\datapacks\SurvivalistsVsHitmen\node_modules\ts-node\src\index.ts:1046:12) at Module.load (internal/modules/cjs/loader.js:986:32) at Function.Module._load (internal/modules/cjs/loader.js:879:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! manhunt@1.0.0 build: npx ts-node index.ts npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the manhunt@1.0.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Beatso\AppData\Roaming\npm-cache_logs\2020-11-29T13_33_24_088Z-debug.log

After replacing all mcfunctions with MCFunction, i got this error:

console error message > npx ts-node index.ts

C:\Users\Beatso\OneDrive\Documents\Minecraft\datapacks\SurvivalistsVsHitmen\node_modules\ts-node\src\index.ts:500 return new TSError(diagnosticText, diagnosticCodes) ^ TSError: ⨯ Unable to compile TypeScript: index.ts:2:22 - error TS2305: Module ‘“./node_modules/sandstone/core”’ has no exported member ‘saveDatapack’.

2 import { MCFunction, saveDatapack } from “sandstone/core” ~~~~~~~~~~~~

at createTSError (C:\Users\Beatso\OneDrive\Documents\Minecraft\datapacks\SurvivalistsVsHitmen\node_modules\ts-node\src\index.ts:500:12)
at reportTSError (C:\Users\Beatso\OneDrive\Documents\Minecraft\datapacks\SurvivalistsVsHitmen\node_modules\ts-node\src\index.ts:504:19)
at getOutput (C:\Users\Beatso\OneDrive\Documents\Minecraft\datapacks\SurvivalistsVsHitmen\node_modules\ts-node\src\index.ts:739:36)
at Object.compile (C:\Users\Beatso\OneDrive\Documents\Minecraft\datapacks\SurvivalistsVsHitmen\node_modules\ts-node\src\index.ts:955:32)
at Module.m._compile (C:\Users\Beatso\OneDrive\Documents\Minecraft\datapacks\SurvivalistsVsHitmen\node_modules\ts-node\src\index.ts:1043:43)      
at Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Object.require.extensions.<computed> [as .ts] (C:\Users\Beatso\OneDrive\Documents\Minecraft\datapacks\SurvivalistsVsHitmen\node_modules\ts-node\src\index.ts:1046:12)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! manhunt@1.0.0 build: npx ts-node index.ts npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the manhunt@1.0.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Beatso\AppData\Roaming\npm-cache_logs\2020-11-29T13_34_49_146Z-debug.log

what am I doing wrong, and how can I fix this issue? is this an issue with the release of sandstone, or what I’m doing? link to my code

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
TheMrZZcommented, Nov 29, 2020

So the bug is fixed? Perfect!

I’m happy to hear it, thanks 🙂 Once the documentation is over, I’ll officially release it & I hope it will get some traction!

Once again, feel free to contact me on Discord if you need to. I’ll close this issue for now, have a nice week!

1reaction
TheMrZZcommented, Nov 29, 2020

Hello,

Indeed, Sandstone v0.6.0 changed a lot of things. This isn’t documented yet (sorry for that), but to use Sandstone v0.6.0 you will probably want to create a whole new project (don’t worry, the code stays identical, but the structure of the project changed).

Basically, Sandstone v0.6.0 introduces a CLI, which helps to create/build/watch projects. This is a beta CLI for the moment, and is not battle-tested. It adds support for a configuration file, automatic saving, automatic import of your files etc…

Therefore, you have 2 options:

  • Fix a bunch of stuff and stay on the “manual” version
  • Try the new, beta CLI and upgrade to the “automatic” version

If you want to stay on the “manual” one, you will need to import savePack instead of saveDatapack. This change is to be future-proof, since Sandstone will probably support resource packs in the long run. You also need to upgrade to Sandstone v0.6.2, which fixes the BasePath-related bug (thanks for letting me know btw, you’re the first to report this bug!)

If you want to upgrade to the CLI, you’ll have to create a new project. You will get automatic saving, neat configurations, and a nice CLI that is way better than running ts-node index.ts! Here are the steps:

  1. Go to a root folder, like projects. A sub folder will be created for your Sandstone project.
  2. Run npx sandstone-cli create my-project-name. Change my-project-name to your project’s name: it will not be the name of the data pack, just the name of the folder, so don’t worry
  3. Answer all the questions. All your answers can be changed later in the configuration file, so if you make a mistake don’t worry!
  4. Open your new projects, that’s it!

To build, you can run npm run build. To build & rebuild on each change, you can run npm run watch. Once again, it’s a very beta CLI, so expect a few bug. Report them & I’ll fix them as soon as possible!

I’ll keep this issue opened for a bit if you’ve got any problem, then I’ll close it. I’m interested in getting your feedback on Sandstone btw: add me on Discord (TheMrZZ#9307), or drop by the Minecraft Commands Discord and tag me if you want!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation needs update to 0.6.0 · Issue #911 - GitHub
Hi there. Updating to 0.6.0, I ran into the problem that req.logout() changed. It now needs a done callback. Unfortunately the documentation ...
Read more >
solr-operator 0.6.0 - Artifact Hub
You can now do a managed update of Solr while using ephemeral data. The operator will manage data migration during the rolling update...
Read more >
Release 0.6.1 - Statsmodels
statsmodels 0.6.1 is a bugfix release. All users are encouraged to upgrade to 0.6.1. See the list of fixed issues for specific backported...
Read more >
Modifying an npm package locally to manually fix dependency ...
js, I've run into an npm dependency tree issue. I'm attempting to do something like npm install --save-dev @types/bcrypt @types/passport @types/ ...
Read more >
Fixing Session Fixation. Version 0.6.0 of passport has been…
Version 0.6.0 of passport has been released, which improves robustness against classes of session fixation attacks.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found