the `persist` option of

the persist option of setupDevPlatform doesn't appear to be working as expected, unless I have it configured incorrectly
if (process.env.NODE_ENV === "development") {
await setupDevPlatform({
persist: "../../.wrangler/search/v3",
})
}
if (process.env.NODE_ENV === "development") {
await setupDevPlatform({
persist: "../../.wrangler/search/v3",
})
}
but it still creates and accesses data from .wrangler/state/v3, I've tried both with and without v3 at the end of the path
6 Replies
Dario
Dario•9mo ago
yeah that should work 🤔 mh... any chance you can share your project or create an issue with a minimal reproduction so that I can have a look? actually no wait.... are you sure it isn't wrangler that creates the directory?
seasie
seasieOP•9mo ago
I'm not using wrangler directly, and it's creating the sqlite file as well, not just the directory. I'll work on a reproduction to try and figure this out. https://github.com/sseasie/persist-minirepro
Dario
Dario•9mo ago
ok sorry @seasie that's my bad 😓 what you shared above is the wrong usage of the API you should do this instead:
if (process.env.NODE_ENV === "development") {
await setupDevPlatform({
persist: {
path: "../../.wrangler/state/v3"
},
})
}
if (process.env.NODE_ENV === "development") {
await setupDevPlatform({
persist: {
path: "../../.wrangler/state/v3"
},
})
}
Dario
Dario•9mo ago
if you put a // @ts-check at the top of your next.config.mjs file you should see the issue clearly
No description
seasie
seasieOP•9mo ago
no worries, thanks for taking a look still! better to figure it out later than never. it's my fault for not checking the type, I assumed it was boolean | string
Dario
Dario•9mo ago
yeah sorry about that, I can see that it can be a bit unintuitive 😅 , we went with an object to make it more future proofed
Want results from more Discord servers?
Add your server