Feliz icon indicating copy to clipboard operation
Feliz copied to clipboard

Difficulties getting the template to work out of the box.

Open John-Colvin opened this issue 2 years ago • 2 comments

Apologies if there is something very obvious I'm missing,

I ran dotnet new feliz -n testercode, followed by femto and then npm run start.

Initially I got ERR_OSSL_EVP_UNSUPPORTED errors, so I added hashFunction: "sha256" to fix that in module.exports.output, which seems to have worked, but then I get this:

PS C:\Users\JLC26\Git\testercode\feliztest\testercode\src> npm run start

> prestart
> dotnet tool restore

Tool 'fable' (version '3.6.2') was restored. Available commands: fable
Tool 'femto' (version '0.12.0') was restored. Available commands: femto

Restore was successful.

> start
> dotnet fable watch ./src -s --run webpack-dev-server

Fable: F# to JS compiler 3.6.2
Thanks to the contributor! @voronoipotato

Parsing src\App.fsproj...
Retrieving project options from cache, in case of issues run `dotnet fable clean` or try `--noCache` option.
Project and references (57 source files) parsed in 83ms

Started F# compilation...
F# compilation finished in 5613ms

Loaded Feliz.HookAttribute from ..\..\..\..\.nuget\packages\feliz.compilerplugins\1.6.0\lib\netstandard2.0\Feliz.CompilerPlugins.dll
Loaded Feliz.ReactComponentAttribute from ..\..\..\..\.nuget\packages\feliz.compilerplugins\1.6.0\lib\netstandard2.0\Feliz.CompilerPlugins.dll
Started Fable compilation...
Fable compilation finished in 379ms

.> cmd /C node_modules\.bin\webpack-dev-server
Watching...
Bundling for development...
Failed to load ./.env.
i 「wds」: Project is running at http://localhost:8080/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from C:\Users\JLC26\Git\testercode\feliztest\testercode\public
C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\html-webpack-plugin\lib\child-compiler.js:190
    return childCompilation.assets[helperFileName].source();
                                                   ^

TypeError: Cannot read properties of undefined (reading 'source')
    at C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\html-webpack-plugin\lib\child-compiler.js:190:52
    at Array.map (<anonymous>)
    at extractHelperFilesFromCompilation (C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\html-webpack-plugin\lib\child-compiler.js:189:43)
    at C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\html-webpack-plugin\lib\child-compiler.js:113:13
    at C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\webpack\lib\Compiler.js:343:11
    at C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\webpack\lib\Compiler.js:681:15
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\tapable\lib\Hook.js:154:20)
    at C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\webpack\lib\Compiler.js:678:31
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\tapable\lib\Hook.js:154:20)
    at C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\webpack\lib\Compilation.js:1423:35
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\tapable\lib\Hook.js:154:20)
    at C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\webpack\lib\Compilation.js:1414:32
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\JLC26\Git\testercode\feliztest\testercode\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)

Node.js v17.9.0

John-Colvin avatar Apr 08 '22 20:04 John-Colvin

Hi @John-Colvin, thanks for opening the issue and for the details. The template should work out of the box. Though I haven't tested it with latest nodejs so it could be the issue. I will have a look

Zaid-Ajaj avatar May 09 '22 22:05 Zaid-Ajaj

I also hit this issue and confirmed that it comes up based on nodejs version. I hit this when running on latest (18.7), but it is not an issue on the LTS nodejs version (16.16). For the time being I am reverting to LTS until I have time to figure out what needs to be changed to get it updated.

bisen2 avatar Aug 24 '22 20:08 bisen2