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

Azure functions fails to start in Visual Studio 2017 if User folder has norwegian letters #332

Closed
Velcrow81 opened this issue Dec 5, 2017 · 19 comments
Assignees
Labels

Comments

@Velcrow81
Copy link

I recently tried azure functions in Visual Studio 2017, but I am unable to start it locally. When I tried to run the project I was prompted to install azure.function-cli since it was missing. The install works fine, but the start console crashes right after listing out HTTP functions with the following error:

module.js:471
   throw err;
   ^

Error: Cannot find module 
'C:\Users\\{UserName}\AppData\Local\Azure.Functions.Cli\1.0.7\edge\double_edge.js'
at Function.Module._resolveFilename (module.js:469:15)
...

See image for error message (crash closes window very fast, so I had to record a video and capture a screen from it to see the error message)
image

In the error message I can see that Ø is not shown correctly (my name is Bjørn, but in the path it is shown as Bj{wierd symbol that does not look like Ø}rn, which leads me to think that the files are not found because of this. The files are on disk at the correct path, but the project cant find it.

@lofotr
Copy link

lofotr commented Dec 7, 2017

I have the exact same problem.

By doing some investigation, I found out that this is a problem with edge.js;
someone has proposed a pull request for this, however I don't think anyone is working much on edge at the moment. tjanczuk/edge#555

It's related to this issue, #134, that was closed in May.

@Velcrow81 Did you find any workaround?

@Velcrow81
Copy link
Author

Nope. My workaround is that I don't run my functions locally :) I tried to change my user name, but after doing some regedit changes, my user disappeared so I rolled back and decided to wait and test i azure for now

Btw, your links are broken.

@nelak
Copy link
Contributor

nelak commented Dec 7, 2017

@Velcrow81 it sounds like you are trying to run javascript with azure functions, have you tried installing beta cli, with the core tag? The new runtime uses a worker model that uses nodejs directly instead of edgejs it might be worth a try.

@Velcrow81
Copy link
Author

Velcrow81 commented Dec 7, 2017

I created a C# azure function project in Visual Studio 2017. When I ran the project, I was prompted to install the cli since it was missing. I accepted and it was installed in my user profile folder. If what was installed is related to JavaScript, then maybe this is another error?

@nelak
Copy link
Contributor

nelak commented Dec 7, 2017

Can't say for sure, v1 of the runtime used EdgeJS to run javascript, based on this I assumed you were trying to run a javascript function. Still you can try installing the beta cli running npm install -g azure-functions-core-tools@core and give that a try.

@lofotr
Copy link

lofotr commented Dec 8, 2017

@Velcrow81, I fixed the links :)

I managed to change the folder name, I think this is bad practice, but now it works. However what you can do instead, if you only want to test functions locally, is to move/make a copy of the cli folder somewhere outside the profile folder, and then run functions manually through the console; I've tried to find a way to start it from VS, but I've used to much time on this already so I gave up.

@nelak Would what you propose work with Visual Studio? Of course I could always give it a try, but I'd rather ask first, I've spent to much time on this.

@nelak
Copy link
Contributor

nelak commented Dec 8, 2017

@lofotr No idea really, I'm using VSCode and the cli for testing my Azure Functions

@Velcrow81 Velcrow81 changed the title Azure functions fails to start if User folder has norwegian letters Azure functions fails to start in Visual Studio 2017 if User folder has norwegian letters Dec 11, 2017
@ahmelsayed ahmelsayed assigned ahmelsayed and unassigned patricklee2 Feb 9, 2018
@Velcrow81
Copy link
Author

@ahmelsayed : Any progress on this? :)

@singstad
Copy link

@Velcrow81 I have had the same problem and used symbolic linking as a workaround. https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

@ahmelsayed
Copy link
Contributor

@Velcrow81 sorry for not replying earlier. The problem is that I'm pretty sure it's caused by edgejs dependency, not this project or the functions host per se. In v2, we're using node.exe directly, so this shouldn't be an issue there. I'll let @jeffhollan comment on timeline for v2, or if this will be fixed in v1, though I doubt it.

@Velcrow81
Copy link
Author

@singstad : Thanks for the tip. Could you provide me with a sample on how you made this work? I tried mklink /J C:\Users\Bjørn\AppData\Local\Azure.Functions.Cli C:\Users\Bjorn\AppData\Local\Azure.Functions.Cli and the reverse but non worked. It still tries the path with Ø in it. At what level did you create the link? Local? Edge?

@ahmelsayed : Thanks for the update :)

@jeffhollan
Copy link

@Velcrow81 you can create v2 functions in Visual Studio 2017 today. I'm wondering if when you create a new function project and select .NET Standard Preview if you still see this issue pop up? As @ahmelsayed mentioned in v2 we call node.exe directly and also believe we provide flags for Visual Studio to not attempt to start the node process if only a .NET function app.

@singstad
Copy link

@Velcrow81 : It has been I while since I had this problem but try replacing your norwegian character with a questionmark "?". You only have to do this for the user folder so i guess
mklink /J "c:\Users\Bj�rn" "c:\Users\Bjørn" should work.

image

@Velcrow81
Copy link
Author

Seems ? is an illegal character in folder names:
C:\Users>mklink /J "c:\Users\Bj?rn" "c:\Users\Bjørn"
The filename, directory name, or volume label syntax is incorrect.

@jeffhollan
Copy link

Just trying to clarify - are you still seeing this issue for new V2 function apps using the latest version of VS tooling?

@Velcrow81
Copy link
Author

I tried a new Azure Function project today and it works for V2 :) Then I have another reason to upgrade my V1 functions.

@TimNilimaa
Copy link

Justed filed a new issue on this, #768 Issue is that we must use v1 as we need support for Open API/Swagger.

@ahmelsayed
Copy link
Contributor

Closing this issue as mentioned on #768. This issue is in the underlying dependencies of the core-tools, namely https://github.com/Azure/azure-functions-host which is using edgejs. I'd follow up on the host repo for any updates

@aquamoth
Copy link

aquamoth commented Dec 5, 2019

Creating a juncion point with "mklink" as suggested above really saved the day for me. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Jan 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

9 participants