Open ironmanu opened 3 weeks ago
I'm going to follow the following steps to help you solve the GitHub issue:
Here are the changes we decided to make. I'm done making edits and now I'm just validating the changes using a linter to catch any mistakes like syntax errors or undefined variables:
components/particles/projects/ng-particles/src/lib/ng-particles.component.ts
Import the isPlatformBrowser function from @angular/common to check if the code is running in a browser environment.
---
+++
@@ -13,4 +13,5 @@
Move,
} from '@tsparticles/engine';
import { NgParticlesService, NgxParticlesModule } from '@tsparticles/angular';
-import { loadSlim } from '@tsparticles/slim';
+import { loadSlim } from '@tsparticles/slim';
+import { isPlatformBrowser } from '@angular/common';
Your changes have been successfully made to the branch sweep/document_is_not_defined
. I have validated these changes using a syntax checker and a linter.
[!TIP] To recreate the pull request, edit the issue title or description.
This is an automated message generated by Sweep AI.
Details
Details Description: I'm encountering an error with particle rendering in an Angular 18 environment. Despite having the error, the particles are rendering, but it would be nicer not having that error
Error:
Steps to Reproduce: Set up an Angular 18 project environment. Integrate particle rendering functionality.
Environment: Angular CLI: 18.0.2 Node: 18.19.33 TS 5.4.5 OS: macOS x64
Angular: 17.3.0 ... animations, cdk, common, compiler, compiler-cli, core, forms ... material, platform-browser, platform-browser-dynamic, router
Package Version @angular-devkit/build-angular@18.0.2 @angular/animations@18.0.1 @angular/cli@18.0.2 @angular/common@18.0.1 @angular/compiler-cli@18.0.1 @angular/compiler@18.0.1 @angular/core@18.0.1 @angular/forms@18.0.1 @angular/platform-browser-dynamic@18.0.1 @angular/platform-browser@18.0.1 @angular/platform-server@18.0.1 @angular/router@18.0.1 @angular/ssr@18.0.2
Particle rendering library/version: @tsparticles/angular Additional Information: These are the libraries and versions used: @tsparticles/angular@3.0.0 @tsparticles/engine@3.4.0 @tsparticles/slim@3.4.0
My component:
The HTML is just
Thanks in advance to anyone willing to help!