Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor Snowpack: Failed to resolve module specifier "lodash". Relative references must start with either "/", "./", or "../"

$
0
0

I'm trying to use npm and snowpack in Blazor following this articlehttps://nbarraud.github.io/js-in-blazor.html

But when trying to import the bundle i get this error:

Microsoft.JSInterop.JSException: Failed to resolve module specifier "lodash". Relative references must start with either "/", "./", or "../".TypeError: Failed to resolve module specifier "lodash". Relative references must start with either "/", "./", or "../".   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)   at BlazorApp2.Components.Pages.Home.OnAfterRenderAsync(Boolean firstRender) in C:\Users\user\source\repos\BlazorApp2\BlazorApp2\Components\Pages\Home.razor:line 10   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

Smaller issue that can be solved by lowering the snowpack version to 3.0.13 for example is this one:

[@snowpack/plugin-optimize] Error: ENOENT: no such file or directory, open 'C:\Users\user\source\repos\BlazorApp2\BlazorApp2\wwwroot\js\_snowpack\optimize-manifest.json'1>C:\Users\user\source\repos\BlazorApp2\BlazorApp2\BlazorApp2.csproj(10,3): error MSB3073: The command "cd JS && npm run snowpack-build" exited with code 1.

Anyway you can find the repo here:https://github.com/MefestoSerlo/blazor-snowpack-issue/tree/master


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>