You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I wanted to move my backend project(Nextjs APIs) to Deno with Oak.
In the structure I built using fs/walk.ts inside the std package, I need to import the files inside the “api” folder one by one and I do as.
import{walk}from'https://deno.land/[email protected]/fs/walk.ts';constcwd=Deno.cwd();constendpoints: Array<{endpoint: {pattern: URLPattern;method: AllMethods;};handler: (ctx: ctx)=>Response|Promise<Response>;}>=[];forawait(constwalkEntryofwalk(cwd)){consttype=walkEntry.isSymlink
? 'symlink'
: walkEntry.isFile
? 'file'
: 'directory';console.log(type,walkEntry.path);if(type!=='file'){continue;}// Format path and look, if not in api folder, continueconstpath=`.${walkEntry.path.substring(cwd.length).replaceAll('\\','/')}`;if(!path.startsWith('./api')){continue;}constactualPath=Deno.build.os==='windows'
? path
: walkEntry.path;letpattern,GET,POST,PUT,DELETE,PATCH;try{({ pattern,GET,POST,PUT,DELETE,PATCH}=awaitimport(actualPath));}catch(error){console.error(`Failed to import ${actualPath}`,error);continue;}// ...}
started project and made root handler, logging, routing, models and more and worked so well, it's still working well in my local(which Windows filesystem), but when I wanted to deploy in deno deploy, can't use dynamic import properly because of ubuntu filesystem and says
Describe the bug
Today I wanted to move my backend project(Nextjs APIs) to Deno with Oak.
In the structure I built using fs/walk.ts inside the std package, I need to import the files inside the “api” folder one by one and I do as.
started project and made root handler, logging, routing, models and more and worked so well, it's still working well in my local(which Windows filesystem), but when I wanted to deploy in deno deploy, can't use dynamic import properly because of ubuntu filesystem and says
So I tried splitting operation system, tried so much way that possible to fix that, but nothing is worked.
Mine repository is public if you need to see all workspace: https://github.com/SwiftBuddiesTR/swiftbuddies-backend
Steps to Reproduce
Expected behavior
Importing ts file normally that how works in Windows.
Environment
Local
Deno Deploy
The text was updated successfully, but these errors were encountered: