@FlorianRappl we have created an app using the piral framework, and we try to load one micro app by using the pilet configuration and registered the page, it successfully integrated, now the problem for us.
The micro-app has its own routing which is now breaking saying the below error
PIRAL_AUTH_LOCAL_PASS
env variable will not actually change the password if the feed service has been spun up once already and created the users. I wanted to verify this is the desired behavior before we explore other avenues. We dont plan on using local auth for very long, but it would be much easier to roll a password if just changing the env var and redeploying did that. I dont see an API, only changing via portal
have you ever seen
system.jss:72 Failed to load SystemJS module http://url-to-index.js ReferenceError: process is not defined
Process in this context is process.env.REACT_APP_TRACKING_ID
?
I notice that piral-cli-webpack5 is adding the webpack.DefinePlugin
new webpack_1.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
"process.env.REACT_APP_TRACKING_ID": JSON.stringify(process.env.REACT_APP_TRACKING_ID ?? 'NOT_SET')
})
And it is definitely getting called when I run pilet build --bundler webpack5
but process is still undefined in the browser.
export interface ReactElement {}
@FlorianRapplI am trying to wrap an Angular app inside the Piral but the angular app dependencies on the ionic framework. , the angular app is running, but when integrated into the Piral framework, we are getting below errors, I am suspecting it is related to loaders configuration in webpack. Can you throw some light on this issue? Any help appreciated.
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
<ion-header>
@FlorianRappl - Accessing config file values within Piral angular (pilet)
I have an Angular application as a Pilet for my Piral application. I'm trying to access a config value passed from Piral application via PageComponentProperties. As described in this page, https://docs.piral.io/plugins/piral-ng, I'm trying to access the page Component Properties ("PageComponentProps") as follows within AppModule.
export class AppModule {
@Input('Props') public props: PageComponentProps<any>;
}
And I'm registering the angular component as follows,
app.registerPage(/test-location, app.fromNg(AppModule));. However I'm getting following error, https://i.stack.imgur.com/WxO7f.png
I have a problem. When I run command npx pilet debug --env --port 80 - pilets are downloaded from localhost and it doesn't work with custom domains. In file piral/src/tooling/piral-cli/src/injectors/pilet.ts I found switch for it: this.piletApi = /^https?:/.test(options.api) ? options.api : : ${config.ssl ? 'https' : 'http'}://localhost:${config.port}${options.api}
.
What exactly options.api is? How can I make pilet debug works with custom domain?
Thank you in advance
Hi. Thanks for the great work in piral.blazor v2.
It fixed the problem we had with DI in 3rd party packages.
I now have 2 questions i couldn't find an answer for in the docs.
I can call js functions on the pilet api when my pilet is loaded via the setup.tsx file.
Is there also a way to call such functions when the pilet is unloaded?
A concrete example might be that i register a menuItem and when i remove the pilet via f.e. the browser plugin the Menuitem should also be removed. (Currently it stays)
In a Blazor Page-Component i can define the page url like so and get the ID as a Parameter:@page "/tags/update/{Id}"
This does not seem to work after converting my project to a pilet. Is this currently supported?
Also Blazor allowes to add multiple routes to one Page-Component like so:
@page "/tags/create"
@page "/tags/update/{Id}"
Since converting the project to a pilet only the first route is recognized.
Hi, I am working on Default Blazor pilet, When i am trying to load Weather fetchdata page after integrating the PiralInstance, i am getting below error. Any help or suggestion on how to fix ? thank you ~~~
[blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: '<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
System.Text.Json.JsonException: '<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
---> System.Text.Json.JsonReaderException: '<' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan1 bytes)
at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker)
at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first)
at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
at System.Text.Json.Utf8JsonReader.Read()
at System.Text.Json.Serialization.JsonConverter
1[[WeatherBlazorPilet.Pages.FetchData.WeatherForecast[], WeatherBlazorPilet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
at System.Text.Json.Serialization.JsonConverter1[[WeatherBlazorPilet.Pages.FetchData.WeatherForecast[], WeatherBlazorPilet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadCore[WeatherForecast[]](JsonConverter jsonConverter, Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadCore[WeatherForecast[]](JsonReaderState& readerState, Boolean isFinalBlock, ReadOnlySpan
1 buffer, JsonSerializerOptions options, ReadStack& state, JsonConverter converterBase)
at System.Text.Json.JsonSerializer.ContinueDeserializeWeatherForecast[]
at System.Text.Json.JsonSerializer.<ReadAllAsync>d65`1[[WeatherBlazorPilet.Pages.FetchData.WeatherForecast[], WeatherBlazorPilet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
at System.Net.Http.Json.HttpContentJsonExtensions.<ReadFromJsonAsyncCore>d41[[WeatherBlazorPilet.Pages.FetchData.WeatherForecast[], WeatherBlazorPilet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
at System.Net.Http.Json.HttpClientJsonExtensions.<GetFromJsonAsyncCore>d__13
1[[WeatherBlazorPilet.Pages.FetchData.WeatherForecast[], WeatherBlazorPilet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
at WeatherBlazorPilet.Pages.FetchData.OnInitializedAsync() in C:\Users\ishaik\source\WeatherBlazorPilet\WeatherBlazorPilet\Pages\FetchData.razor:line 44
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
~~~
Hi everyone - I just created another channel dedicated to Piral.Blazor
discussions.
We've seen that many discussions now actually take place around Piral.Blazor
. I think separating piral
from Piral.Blazor
might be a good thing.
The subchannel is reachable via https://gitter.im/piral-io/blazor
(node:13) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
{"@fields":{"level":"\u001b[31merror\u001b[39m"},"@message":"\u001b[31m[azure-tablestorage] Could not create table \"audits\".\u001b[39m","@timestamp":"2022-06-26T22:15:06.059Z"}
{"@fields":{"level":"\u001b[31merror\u001b[39m"},"@message":"\u001b[31m[azure-tablestorage] Could not create table \"apikeys\".\u001b[39m","@timestamp":"2022-06-26T22:15:06.114Z"}
.... includes a list of all the tables as well, cut off for brevity
Hi All,
I’ve read lots of posts here – thank you everyone for lots of helpful tips on Piral and thank you so much @FlorianRappl for being here for us!
I’ve got a question about Tailwind: basically, need to get it running at a Piral shell instance.
I’m very new to Piral, Tailwind, postcss, and doing any Webpack configurations – so any tips would be really really appreciated (even if you think that it is trivial, it might be not so obvious for me :) ).
This is what I did so far:
npm init piral-instance -- --target my-app –defaults
npm install -D tailwindcss@latest postcss@latest autoprefixer@latest
@tailwind base;
@tailwind components;
@tailwind utilities;
npm i piral-cli-webpack5
npm i postcss-loader –save-dev
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/*.{html,js, tsx, ts}"],
theme: {
extend: {},
},
plugins: [],
};
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
module.exports ==
extendConfig({
cssLoaderOptions: {
rules: {
test: /.css$/,
exclude: /node_modules/,
use: ["postcss-loader"],
},
},
});
```
Will webpack understand to use postcss to load Tailwind css with my current webpack extention?
Could anything be wrong with my postcss config/loader?
I was only able to find one piral project using Tailwind that I cannot unfortunately get running locally, so any working Piral-Tailwind samples to look at would be really helpful.
Thanks so much!
Hi Florian,
Thanks so much again for all the suggestions – we are progressing quite nicely!
What is the best practise to implement logging out functionality under the following scenario:
I’m creating the Piral instance when the user info is already set in the root component, doing something like that:
if (!loggedIn) return <LoginPage /> else <Piral ... />;
User data is pulled from react context and then createInstance() function uses createAuthApi() to initialize a Piral instance with the given user.
Then I need a way to log out and unmount the current Piral instance created for a certain user.
Ideally, I’d pass a logout handler function to Piral instance menu, but I think Piral by design does not take any custom props.
Is there any way to extend the interface or should I approach it differently?
Thank you so much!
createInstance
. From everything I can gather, my feed server is working... but I'm getting some odd errors that I haven't seen anywhere in issues or this gitter. Hoping someone can help.
Hi - just wondering how to use the api key for authorisation instead of using a valid user session? What do I need to pass into the headers to make a request for example /api/v1/feed/{feed}/contributors
. I can't seem to find it in the docs.
I've set a PIRAL_DEFAULT_API_KEY
in my environment variable and I was hoping this could just be passed in all the requests?