Help: Error message "length of NULL cannot be changed"

When trying to generate colors or change the weight of edges when using igraph I’m generating the error “length of NULL cannot be changed.”

Specifically when running these codes:

    colrs <- c("skyblue", "orchid2", "peachpuff")
    V(net)$color <- colrs[V(net)$source]

I get:

Warning message:
In length(vattrs[[name]]) <- vc : length of NULL cannot be changed

When I run the code:

E(net)$width <- E(net)$weight/6

I get the same error. Has anyone gotten similar errors and know what to do with them in this context? Thank you

I am unable reproduce your problem. Please post a minimal working example of your problem. Perhaps it would then be possible to identify the problem.