Vercel deployment fails "Cannot read properties of undefined (reading 'document')" - npm

I'm building a ReactJS/NextJS website and I was going to deploy it online using Vercel.
During the build I have some warnings as this one:
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
But then I get this fatal error, saying it can't read properties of undefined.
I'm not sure where to look at, something worth noticing is when I run yarn run build on my local machine, it does successfully compile as shown below
It's my first try experimenting with this tech so any hint would be appreciated!
Thanks

Related

Serverless deprecation warning on .env files

I am using serverless framework to deploy react web application. I've set up a CI/CD pipeline for deployment. when serverless template gets executed I am receiving several deprecation warnings.
Serverless: Deprecation warning: Detected ".env" files. In the next major release variables from ".env" files will be automatically loaded into the serverless build process. Set "useDotenv: true" to adopt that behavior now.
More Info: https://www.serverless.com/framework/docs/deprecations/#LOAD_VARIABLES_FROM_ENV_FILES
Serverless: Deprecation warning: Variables resolver reports following resolution errors:
- Cannot resolve variable at "provider.profile": Value not found at "env" source
From a next major this will be communicated with a thrown error.
Set "variablesResolutionMode: 20210326" in your service config, to adapt to new behavior now
More Info: https://www.serverless.com/framework/docs/deprecations/#NEW_VARIABLES_RESOLVER
The way I understand these warnings, it is trying to load environment variables from .env file from the serverless directory. But I've stored my variables from other files(abc.config) and loading them to the serverless template through that file and not from the .env file. and for this reason I am getting these warnings.
Also I've used serverless-dotenv-plugin to use environment variables in .env file for local deployment and that's why the .env file has to be there in the serverless directory. But for now loading variables from abc.config file is working fine and in the future, I want to load variables from the same file(abc.config). But in the future, if I use the same approach for environment variables, that will throw an error instead of giving a warning.
Questions 1: I am not sure how would I tackle this issue. because in the upcoming serverless version release this will throw an error.
Question 2: What if I install a specific serverless version. for example; npm install -g serverless#2.45.0 in that case, in the future will I still get these deprecation warnings? In theory, I'll be still using the old serverless version and this version supports loading variables from other files. So I should not be getting these warnings. I can be wrong. but what should be the ideal approach to resolve these warnings ahead of time?
Any help would be greatly appreciated.
Thank you.
You should set the deprecation variables in your serverless.yml file and verify that serverless deploy is successful and the framework interpolates your variables as you intend.
The warning messages explain the process. Simply add the rules to your serverless.yml file:
useDotenv: true
variablesResolutionMode: 20210326
The second warning message will be an error, provider.profile wasn't able to be resolved. You can solve this with a conditional, ie:
${provider.profile, 'default'}
Or you can ensure that provider.profile is always set. It's not possible to help further without seeing the serverless.yml file.

Error in dbt compile with a local package

We are setting up a new dbt project which will probably have several engineers working on it. To reduce merge conflicts I'm playing with creating "sub" projects per data subject area and then referencing those as local or git packages in a master project that runs the whole pipeline.
I created one simple "sub" project with some models and schema tests and referenced this as a local package in a master project. dbt deps installed it ok, but when I run "dbt compile" I get an error like the below, does anyone have any ideas please? dbt version 0.19.0 running on ubuntu 18.04 against a snowflake target
Runtime Error
Compilation Error in test not_model_column_one (models/package_name/package_metadata.yml)
'test_not' is undefined
Turns out it was a simple typo, how embarassing. Somehow when I was moving files around into sub-projects an underscore got removed from "not_null" in one of my metadata files. The project previously worked fine so not sure how it happened, must have been fat fingers.

Build:Cannot find type definition file for webpack-env

we have a .net core Asp.net framework SPA. we performed below commands using Nuget package manager console on VS 2017. This would create all the node_modules stuff but while building the project it would throw error and fail "Build:Cannot find type definition file for 'webpack-env'". It happens for few of us. For some it would happen randomly. We also tried to get node_modules on our build server using VSTS npm step and it would throw the same error. Any help?
npm init -y (to get/create package.json)
npm install
FYI: we have a webpack-env folder under #types folder
Go to 'Dependencies' -> right click on 'npm' and click 'Restore Packages
We get this regularly when creating a project offline (no internet access at the time... Which happens all the time round here...).
We think its due to:
a) no "base" client (npm) packages in the base templates, so it MUST download these when created or first build, and;
b) some bug or bad config in the templates/VS/npm where if the project is built or attemplted to be built then it never tries to go get missing packages when it IS online...
We usually "just know this" and right click the projects "npm" widget and choose "update packages" or "install missing" (which is sometimes grey for us) but this usually kicks it into working again... obviuolsly need to rebuild again after this.
Occasionally this doesn't work so we close VS change the app.js file and reopen and then try the above again... so far this has fixed it for us.

Apple Mach-O Linker Error IOS

When i tried to build and run my project im getting this error.I tried may steps like clean and run, check with workspace.project but still im getting the error.No further details were in the error message. "Linker command failed with exit code 1(use -v to see invocation)
There can be many reasons for this problem, sadly with such little knowledge of your project I can only suggest some fixes
Check for any caution messages and try to fix them
This can also be caused by using #import to import an .m file, if you are using this then remove it.
Sometimes this can be caused by frameworks and libraries, If you are using an external or custom framework, you probably need to add it to the "Frameworks" folder inside the application.
Hope this helped but if it didn't I might need some more info on your project.
Go to Project file -> Build Phases and check if there ara any red icons (specially for Compile Sources or Copy Bundle Resources)

How to install Defense4All for OpenDaylight?

(This is a duplicate question from ServerFault, but seems that is not a right place to ask and it got downvoted for no reason, so I re-post here)
Basically I am setting up an OpenDaylight controller for my SDN. And I am trying to install an application - Defense4All, which from the documentation, will communicate with the controller host.
I am reading the installation guide of it in https://wiki.opendaylight.org/view/Defense4All:Installation_Guide , but it seems that the link of getting binary of Defense4All is dead, and I can't find a way to get the binary of Defense4All. I managed to compile from source but I have no idea how to proceed after successful build. Anyone idea?
I finally fixed the issue. Hope someone feels useful.
I managed to compile the source with mvn install, which it successfully did all the compilation but it did not give me a binary. But I am able to do so using mvn package.
To be specific, under directory dfapp after unzipping the source zip file:
vm:~/defense4all-release-helium-sr3/dfapp$ mvn package
After a long build, you will find the binary file in dfapp.aggregate/target
Make sure you allocate enough memory (say, 2048) to the VM or it will suffer from insufficient memory error.
There are also some dependencies such as git and rpm, it varies with your machines, so take notice of the error log.