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

Run from package on Windows = broken node_modules symlinks #3295

Closed
aaronadamsCA opened this issue May 12, 2021 · 2 comments
Closed

Run from package on Windows = broken node_modules symlinks #3295

aaronadamsCA opened this issue May 12, 2021 · 2 comments

Comments

@aaronadamsCA
Copy link

aaronadamsCA commented May 12, 2021

Subscription: b525****-****-****-****-ac8f48efaf10
App name: func-*****graph-dev-03

This function is currently failing to execute with the following error message:

[Error] Executed 'Functions.graphql' (Failed, Id=0fca6076-990b-4275-b8cc-8c6b8a08c10d, Duration=14ms)
Result: Failure
Exception: Worker was unable to load function graphql: 'SyntaxError: Unexpected token '.''
Stack: C:\home\site\wwwroot\node_modules\@xxxxxxxxx\env:1
../../packages/env
^SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\home\site\wwwroot\graphql\authentication\shopify-authentication.js:4:15)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

The file at C:\home\site\wwwroot\node_modules\@xxxxxxxxx\env should be a symbolic link to ../../packages/env, but it appears Node.js is attempting to parse the contents of the symlink instead of following it.

That ZIP package is created on GitHub Actions using https://github.com/Azure/functions-action. I'm stuck using a Windows function due to Azure/functions-action#58 + lack of support for Linux consumption functions in Canada Central. So I need to figure out how to get these symlinks working as-is.

This is similar to #2946 but for Windows apps.

@aaronadamsCA
Copy link
Author

aaronadamsCA commented May 12, 2021

For now, I am successfully working around the failing symbolic links by adding the following step to my GitHub Actions workflow:

      - name: Move local packages to node_modules directory
        run: |
          rm node_modules/@xxxxxxxxx/*
          mv packages/* node_modules/@xxxxxxxxx/

This replaces the symbolic links with the packages themselves, which makes the function work again (which also confirms the problem was with the symbolic links). But obviously this is a step that shouldn't be necessary, and makes orchestrating builds more complex than it needs to be.

@jvano
Copy link
Member

jvano commented Apr 29, 2024

Hi

If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure:
https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request

This way we can better track and assist you on this case

Thanks,

Joaquin Vano
Azure App Service

@jvano jvano closed this as completed Apr 29, 2024
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

No branches or pull requests

2 participants