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

Not working on "Deno Deploy" #32

Open
guildenstern70 opened this issue Oct 19, 2021 · 10 comments
Open

Not working on "Deno Deploy" #32

guildenstern70 opened this issue Oct 19, 2021 · 10 comments

Comments

@guildenstern70
Copy link

When deployed on Deno Deploy it gives the following error:

  EvalError: Code generation from strings disallowed for this context     at new Function ()     at 
  https://deno.land/x/view_engine@v1.5.0/lib/engines/ejs/ejs.js:117:28
  --
  isolate start time: 6938 us
@guildenstern70
Copy link
Author

@gjuoun
Copy link
Member

gjuoun commented Apr 11, 2022

please use the newest version, thanks

@gjuoun gjuoun closed this as completed Apr 11, 2022
@guildenstern70
Copy link
Author

It appears that the problem is still there:

`

0 EvalError: Code generation from strings disallowed for this context at new Function () at https://deno.land/x/view_engine@v10.5.1/lib/engines/ejs/lib/ejs.js:117:28
1 isolate start time: 2 milliseconds
2 EvalError: Code generation from strings disallowed for this context at new Function () at https://deno.land/x/view_engine@v10.5.1/lib/engines/ejs/lib/ejs.js:117:28
3 isolate start time: 2 milliseconds
4 EvalError: Code generation from strings disallowed for this context at new Function () at https://deno.land/x/view_engine@v10.5.1/lib/engines/ejs/lib/ejs.js:117:28
5 isolate start time: 2 milliseconds
6 EvalError: Code generation from strings disallowed for this context at new Function () at https://deno.land/x/view_engine@v10.5.1/lib/engines/ejs/lib/ejs.js:117:28
7 isolate start time: 2 milliseconds

`

@gjuoun
Copy link
Member

gjuoun commented Apr 18, 2022

Hey can you give me some code to reproduce it?

@gjuoun gjuoun reopened this Apr 18, 2022
@guildenstern70
Copy link
Author

Sure, here it is: https://github.com/guildenstern70/SmartDeno

The code compiles and runs perfectly in local. The problem arises only when deploying on Deno Deploy.

@gjuoun
Copy link
Member

gjuoun commented Apr 21, 2022

The newest patch version view_engine@v10.5.1b should fix the problem. @guildenstern70

@guildenstern70
Copy link
Author

Ok, problem fixed... but now there is another problem:

View-Engine: Deno.readTextFileSync is not a function

Program starts, but web page is not displayed - again, only on Deno Deploy. Locally it works.

Logs here:

0 | 2022-04-21 6:54:22.928\|INFO \|> GET https://smart-deno-project.deno.dev/ - 1ms
-- | --
1 | View-Engine:  Deno.readTextFileSync is not a function
2 | views/index.njk
3 | 2022-04-21 6:52:8.841\|INFO \|> GET https://smart-deno-project.deno.dev/ - 0ms
4 | View-Engine:  Deno.readTextFileSync is not a function
5 | views/index.njk
6 | 2022-04-21 6:51:29.749\|INFO \|> GET https://smart-deno-project-t8m805gnc1g0.deno.dev/ - 0ms
7 | View-Engine:  Deno.readTextFileSync is not a function
8 | views/index.njk
9 | 2022-04-21 6:51:28.206\|INFO \|> GET https://smart-deno-project-t8m805gnc1g0.deno.dev/ - 1ms
10 | View-Engine:  Deno.readTextFileSync is not a function
11 | views/index.njk
12 | 2022-04-21 6:51:2.549\|INFO \|> GET https://smart-deno-project.deno.dev/ - 1ms
13 | View-Engine:  Deno.readTextFileSync is not a function
14 | views/index.njk
15 | 2022-04-21 6:50:21.499\|INFO \|> GET https://smart-deno-project.deno.dev/ - 2ms
16 | View-Engine:  Deno.readTextFileSync is not a function
17 | views/index.njk
18 | 2022-04-21 6:50:21.491\|WARN \|> 🦕 Deno server running at http://localhost:8000/ 🦕
19 | 2022-04-21 6:50:21.491\|INFO \|> Running in: /src
20 | 2022-04-21 6:50:21.490\|INFO \|> Setting up web routes...
21 | 2022-04-21 6:50:21.487\|INFO \|> Setting up routes...
22 | isolate start time: 0.003115203 seconds

@hirefrank
Copy link

I'm receiving the same issue. Any update?

@hirefrank
Copy link

From the Deno Deploy Discord

That module uses a sync API which is not supported on Deploy
The best course of action for now would be to ask the maintainer to add support for async version as well

@gjuoun Is that a heavy lift to add that support? Thx!

AaronO added a commit to AaronO/view-engine that referenced this issue Jun 14, 2022
@gjuoun
Copy link
Member

gjuoun commented Jun 20, 2022

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

Successfully merging a pull request may close this issue.

3 participants