Skip to content
Back

Appwrite function returns incorrect context.req.path

  • 0
  • Self Hosted
  • Functions
Cord
12 Mar, 2025, 11:13

Since upgrading from Appwrite 1.6.0 to 1.6.1, when running a function locally for development using appwrite run functions --port 3001, the context.req.path is always returning /___vscode_livepreview_injected_script rather than the actual path.

Any thoughts why this is the case?

TL;DR
Developers are experiencing an issue where the `context.req.path` returns `/___vscode_livepreview_injected_script` instead of the actual path after upgrading from Appwrite 1.6.0 to 1.6.1. This could be due to changes introduced in the update. Possible Solution: Check the Appwrite documentation or release notes for any changes related to the function context handling in the new version. Make adjustments accordingly to accommodate the changes and ensure the correct path is retrieved.
Cord
12 Mar, 2025, 11:14
TypeScript
runtime  │ entrypoint    │ path                    │ commands     │ scopes
 ──────────┼───────────────┼─────────────────────────┼──────────────┼────────
  dart-3.5 │ lib/main.dart │ functions/api │ dart pub get │ []

Info: If you wish to change your local settings, update the appwrite.json file and rerun the 'appwrite run' command.
Hint: Permissions, events, CRON and timeouts dont apply when running locally.
Info: Verifying Docker image ...
Info: Building function using Docker ...
Preparing for build ...

Resolving dependencies...

Downloading packages...

+ async 2.13.0
+ boolean_selector 2.1.2
+ collection 1.19.1
+ matcher 0.12.17
+ meta 1.16.0
+ path 1.9.1
+ pub_semver 2.2.0
+ pubspec 2.3.0 (discontinued replaced by pubspec_parse)
+ quiver 3.2.2
+ source_span 1.10.1
+ stack_trace 1.12.1
+ stream_channel 2.1.4
+ string_scanner 1.4.1
+ term_glyph 1.2.2
+ test_api 0.7.4
+ uri 1.0.0
+ yaml 3.1.3

Changed 17 dependencies!
1 package is discontinued.
Cord
12 Mar, 2025, 11:14
TypeScript
found user package appwrite_function_api

added user package as dependency to server.

Updated server import of user code

Building ...

Resolving dependencies...

Downloading packages...

+ async 2.13.0
+ collection 1.19.1
+ dart_appwrite 13.0.0
+ http 1.3.0
+ http_parser 4.1.2
+ lints 5.0.0 (5.1.1 available)
+ meta 1.16.0
+ path 1.9.1
+ source_span 1.10.1
+ string_scanner 1.4.1
+ term_glyph 1.2.2
+ typed_data 1.4.0
+ web 1.1.1

Changed 13 dependencies!

1 package has newer versions incompatible with dependency constraints.
Try `dart pub outdated` for more information.

Resolving dependencies...

Downloading packages...

+ appwrite_function_api 1.0.0 from path /usr/local/build
+ async 2.13.0
+ collection 1.19.1
+ dart_appwrite 13.0.0
+ http 1.3.0
+ http_parser 4.1.2
+ meta 1.16.0
+ path 1.9.1
+ shelf 1.4.2
+ source_span 1.10.1
+ stack_trace 1.12.1
+ stream_channel 2.1.4
+ string_scanner 1.4.1
+ term_glyph 1.2.2
+ typed_data 1.4.0
+ web 1.1.1

Changed 16 dependencies!

Compiling ...

Generated: /usr/local/server/server

Packing build ...

Build finished.

Info: Starting function using Docker ...
Hint: Function automatically restarts when you edit your code.
Success: Visit http://localhost:3001/ to execute your function.
Preparing for start ...
Starting ...
HTTP server successfully started!
context.req.method=GET
context.req.path=/___vscode_livepreview_injected_script
ApiException: Invalid path. (400)
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more